Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BamWriter: use sizeof(uint32_t) increment to swap bytes for big endian architectures #236

Closed
wants to merge 1 commit into from

Conversation

vpa1977
Copy link
Contributor

@vpa1977 vpa1977 commented Jul 8, 2024

This MR resolves #235

Testing:

$ sh -ex run-unit-test
+ pkg=bamtools
+ [  =  ]
+ mktemp -d /tmp/bamtools-test.XXXXXX
+ AUTOPKGTEST_TMP=/tmp/bamtools-test.T9AwaX
+ trap rm -rf /tmp/bamtools-test.T9AwaX 0 INT QUIT ABRT PIPE TERM
+ cd /tmp/bamtools-test.T9AwaX
+ cp -a /usr/share/doc/bamtools/sam_spec_example.bam .
+ cp -a /usr/share/doc/bamtools/filter_script .
+ gunzip -r filter_script sam_spec_example.bam
+ bamtools convert -format fastq -in sam_spec_example.bam -out test.fastq
+ bamtools convert -format json -in sam_spec_example.bam -out test.json
+ bamtools count -in sam_spec_example.bam
6
+ bamtools coverage -in sam_spec_example.bam -out out
+ dpkg --print-architecture
+ ARCH=s390x
+ [ s390x != ppc64el -a s390x != arm64 -a s390x != armel-a s390x != armhf -a s390x != s390x ]
run-unit-test: 27: [: armel-a: unexpected operator
+ [ s390x = ppc64el ]
+ echo The following test is known to time out on s390x architecture (see bug #953939)
The following test is known to time out on s390x architecture (see bug #953939)
+ echo bamtools filter -script filter_script -in sam_spec_example.bam -out out.bam
bamtools filter -script filter_script -in sam_spec_example.bam -out out.bam
+ bamtools header -in sam_spec_example.bam
@HD	VN:1.5	SO:coordinate
@SQ	SN:ref	LN:45

+ bamtools index -in sam_spec_example.bam
+ bamtools random -n 100 -in sam_spec_example.bam -out out.bam
+ bamtools revert -in sam_spec_example.bam -out out.bam
+ bamtools sort -in sam_spec_example.bam -out out.bam
+ bamtools split -mapped -in sam_spec_example.bam
+ bamtools stats -in sam_spec_example.bam

**********************************************
Stats for BAM file(s): 
**********************************************

Total reads:       6
Mapped reads:      6	(100%)
Forward strand:    4	(66.6667%)
Reverse strand:    2	(33.3333%)
Failed QC:         0	(0%)
Duplicates:        0	(0%)
Paired-end reads:  2	(33.3333%)
'Proper-pairs':    2	(100%)
Both pairs mapped: 2	(100%)
Read 1:            1
Read 2:            1
Singletons:        0	(0%)

+ rm -rf /tmp/bamtools-test.T9AwaX

@SoapZA SoapZA closed this in 1ce1d52 Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bamtools crashes/corrupts output data on s390x
1 participant