0.8 - problems reading bam file?

36 views
Skip to first unread message

Queex

unread,
May 10, 2012, 10:54:52 AM5/10/12
to JointSNVMix User Group
I'm trying to get 0.8b2 running, but I'm encountering the following
error trying to use 'classify joint_snv_mix_two':

Exception: Could not open file /..../XXX.bam - is it SAM/BAM format?

The answer is yes, yes it is. I'm not sure how to go about fixing it.
The file in question can be used by samtools without any problems.

There's also a minor issue where the usage information you get from
calling that mode without arguments gives incorrect syntax
information- it seems that it in fact only expects two 'naked'
arguments, the normal and tumour bams, rather than three including
the .fa file. Omitting the .fa file lets it progress further, but then
there's the problem above.

Cheers,

Ben

aroth

unread,
May 10, 2012, 12:18:17 PM5/10/12
to JointSNVMix User Group
Hi Ben,
The usage information is correct the command should be "jsm.py
classify <REF_GENOME_FASTA> <NORMAL_BAM> <TUMOUR_BAM>". Could you post
the full command string you are running, that would help.

Thanks,
Andy

Queex

unread,
May 11, 2012, 6:24:34 AM5/11/12
to JointSNVMix User Group
The invocation I was using was:

jsm.py classify joint_snv_mix_two --chr 21 --out_file $out --
parameters_file $params $ref $norm_bam $tum_bam

Rereading the syntax it implies that 'joint_snv_mix_two' is no longer
required, which makes the syntax problem go away. The bam reading
problem remains, however:

File "/usr/local/bin/jsm.py", line 128, in <module>
args.func(args)
File "run.pyx", line 31, in joint_snv_mix.run.classify
(joint_snv_mix/run.c:1548)
File "run.pyx", line 177, in
joint_snv_mix.run.ModelFactory.get_counter (joint_snv_mix/run.c:3293)
File "bam.pyx", line 19, in
joint_snv_mix.samtools.bam.BamFile.__cinit__ (joint_snv_mix/samtools/
bam.c:804)
File "bam.pyx", line 39, in
joint_snv_mix.samtools.bam.BamFile._open_file (joint_snv_mix/samtools/
bam.c:1020)
Exception: Could not open file <file>.bam - is it SAM/BAM format?

Thanks,

Ben

Queex

unread,
May 11, 2012, 7:08:52 AM5/11/12
to JointSNVMix User Group
Actually, turns out that was a typo of mine, although now it's saying:

File "/usr/local/bin/jsm.py", line 128, in <module>
args.func(args)
File "run.pyx", line 31, in joint_snv_mix.run.classify
(joint_snv_mix/run.c:1548)
File "run.pyx", line 179, in
joint_snv_mix.run.ModelFactory.get_counter (joint_snv_mix/run.c:3339)
File "fasta.pyx", line 15, in
joint_snv_mix.samtools.fasta.FastaFile.__cinit__ (joint_snv_mix/
samtools/fasta.c:655)
Exception: Could not open FASTA file /home/ben/JointSNVMix/hs37d5.fa

aroth

unread,
May 11, 2012, 12:46:42 PM5/11/12
to JointSNVMix User Group
Could you try `jsm.py classify $ref $norm_bam $tum_bam` to see what
happens, just to ensure the extra arguments aren't causing issues.

Would you mind also posting the results of `head /home/ben/
JointSNVMix/hs37d5.fa` and `tail /home/ben/JointSNVMix/hs37d5.fa`?

It seems like the file /home/ben/JointSNVMix/hs37d5.fa is not being
found. It might be a file formatting issue or it might be permissions.

Cheers,
Andy

Queex

unread,
May 14, 2012, 5:12:54 AM5/14/12
to JointSNVMix User Group
I get the same error when it's run with none of the optional
arguments. I've checked the permissions and verified they're 666.

$ head /home/ben/JointSNVMix/hs37d5.fa
>1 dna:chromosome chromosome:GRCh37:1:1:249250621:1
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN

$ tail hs37d5.fa
agtccttatttgagctcaacttaggctaaaagattgaaggctgacgaatgggctctttag
gccggagaaaacggcaatactttattatttttggtttttccttattcctggttcaggggt
tatgcccccaagcctgtaacatcctccctaatggactatctggggggatgctggaggggt
cctcctcggcttcctcctccctttgttccctagtcctagaattcttgcttcccatttttg
gttgctccctgagtctgagtttccctgtgtactcaaccccgcttactggaggtctcttca
cacttcgaaagtcaacttctttgtaactggtttgtccatttccagcagtttccttcctgg
gagaacagaaccatggattgggtctccgcattcgcttcatatctaagatacttctcagtc
acacacactcgacctctgaatatgcccgacgaccaaggcagtgctcatagtccaatcttc
ctacctgggcttgtgcacaaggttgcctggttgccgtggtgcctgcttttctGTTTTTCC
CTG


Cheers,

Ben

aroth

unread,
May 23, 2012, 7:50:49 PM5/23/12
to JointSNVMix User Group
Sorry for the late response, I didn't notice you had replied.

This is a bit strange. Do you get the error using another fasta file?
I have used the hg18 from the BROAD with no problems before
ftp://ftp.broadinstitute.org/bundle/1.5/.

The line of code causing the error to be issued is a call to the
'fai_load' function in the underlying samtools library. If the file
exists it suggest there is something in the file that samtools does
not like. How does 'samtools faidx /home/ben/JointSNVMix/hs37d5.fa'
work?

Cheers,
Andy

Queex

unread,
May 24, 2012, 9:06:01 AM5/24/12
to JointSNVMix User Group
I've decided to downgrade to the latest stable 0.7 release; someone
else on the project has had success running that version with some of
our data sets.

samtools faidx runs without errors, and creates what looks like a
correct .fai file.

Cheers,

Ben

On May 24, 12:50 am, aroth <andrewjlr...@gmail.com> wrote:
> Sorry for the late response, I didn't notice you had replied.
>
> This is a bit strange. Do you get the error using another fasta file?
> I have used the hg18 from the BROAD with no problems beforeftp://ftp.broadinstitute.org/bundle/1.5/.
Reply all
Reply to author
Forward
0 new messages