Skip to content

Commit 29dc0c6

Browse files
authored
Merge pull request #696 from CGATOxford/{IS}_cram_support
{is} cram support
2 parents 536758b + e5d25da commit 29dc0c6

19 files changed

Lines changed: 667 additions & 90 deletions

.github/workflows/tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,8 @@ jobs:
3232
run: |
3333
pip install .
3434
- name: Test with PyTest
35+
env:
36+
# This explicitly overrides the hardcoded RedHat paths inside the package
37+
CURL_CA_BUNDLE: /etc/ssl/certs/ca-certificates.crt
3538
run: |
3639
pytest -v tests/test_umi_tools.py

tests/README

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
Command to make test files for umi_tools extract --either-read testing:
22

33
cd tests; paste <(zcat indrop.fastq.1.gz) <(zcat indrop.fastq.2.gz)|paste - - - - - - - -| awk -F "\t" 'BEGIN{OFS="\n"; srand(0)} {if(rand()>0.5) {print $1,$3,$5,$7 > "delete_me"; print $2,$4,$6,$8 > "delete_me2"} else {print $2,$4,$6,$8 > "delete_me"; print $1,$3,$5,$7 > "delete_me2"}}'; gzip delete_me2 -c > indrop.fastq.2_either_read.gz; gzip delete_me -c > indrop.fastq.1_either_read.gz; rm delete_me delete_me2
4+
5+
6+
Note that CRAM outputs are tested at the string decoded level using pysam, and not at the binary level. This avoids differences due to differenly installed compression libraries.
7+

tests/chr19_1mb.bam

101 KB
Binary file not shown.

tests/chr19_1mb.bam.bai

712 Bytes
Binary file not shown.

tests/chr19_1mb.cram

95.9 KB
Binary file not shown.

tests/chr19_1mb.cram.crai

65 Bytes
Binary file not shown.

tests/chr19_1mb.dedup.cram

3.03 KB
Binary file not shown.

tests/chr19_1mb.dedup.sam

Lines changed: 197 additions & 0 deletions
Large diffs are not rendered by default.

tests/count_help

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,28 @@ Options:
6868
--per-cell group/dedup/count per cell
6969

7070
SAM/BAM options:
71+
--in-format=IN_FORMAT
72+
File format of the input file. Format is usually
73+
implied from the extension of the filename, but maybe
74+
overridden with this option. Default=bam
75+
--out-format=OUT_FORMAT
76+
File format of the input file. Format is usually
77+
implied from the extension of the filename, but maybe
78+
overridden with this option. Default=bam
79+
--input-options=INPUT_OPTIONS
80+
Format string provided to htslib for reading. Mostly
81+
useful for CRAM formatted files. See samtools
82+
documentation
83+
--output-options=OUTPUT_OPTIONS
84+
Format string provided to htslib for writing. Mostly
85+
useful for CRAM formatted files. See samtools
86+
documentation
87+
--reference-filename=REFERENCE_FILENAME
88+
File path or URL to the genome reference to be used
89+
when reading or writing CRAM files. By default, when
90+
reading a CRAM file, the reference recorded in the
91+
input file will be used unless this is specified. When
92+
writing, specifying a reference location is required.
7193
--mapping-quality=MAPPING_QUALITY
7294
Minimum mapping quality for a read to be retained
7395
[default=0]

tests/dedup_help

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,28 @@ Options:
7878
the same position and umi [default=none]
7979

8080
SAM/BAM options:
81+
--in-format=IN_FORMAT
82+
File format of the input file. Format is usually
83+
implied from the extension of the filename, but maybe
84+
overridden with this option. Default=bam
85+
--out-format=OUT_FORMAT
86+
File format of the input file. Format is usually
87+
implied from the extension of the filename, but maybe
88+
overridden with this option. Default=bam
89+
--input-options=INPUT_OPTIONS
90+
Format string provided to htslib for reading. Mostly
91+
useful for CRAM formatted files. See samtools
92+
documentation
93+
--output-options=OUTPUT_OPTIONS
94+
Format string provided to htslib for writing. Mostly
95+
useful for CRAM formatted files. See samtools
96+
documentation
97+
--reference-filename=REFERENCE_FILENAME
98+
File path or URL to the genome reference to be used
99+
when reading or writing CRAM files. By default, when
100+
reading a CRAM file, the reference recorded in the
101+
input file will be used unless this is specified. When
102+
writing, specifying a reference location is required.
81103
--mapping-quality=MAPPING_QUALITY
82104
Minimum mapping quality for a read to be retained
83105
[default=0]

0 commit comments

Comments
 (0)