brentp / bwa-meth

fast and accurate alignment of BS-Seq reads using bwa-mem and a 3-letter genome
https://arxiv.org/abs/1401.1129
MIT License
141 stars 54 forks source link

bwameth set_as_failed=args.set_as_failed #44

Open jrmerritt6 opened 7 years ago

jrmerritt6 commented 7 years ago

I cannot get bwameth to work.

I tried to run the following: bwameth.py --threads 16 --reference ESR1_nmasked.fasta.bwameth.c2t DMA11392-22973-TSF-13-05-POM_S84_L001_R1_001_val_1.fq DMA11392-22973-TSF-13-05-POM_S84_L001_R2_001_val_2.fq -t 12 | samtools view -b - > bwa-meth.bam

Regardless of whether I am in the folder where these files are located or I specify the full path for the reference genome and the for/rev reads, I get the following error: Traceback (most recent call last): File "/nv/hp10/bin/bwa-meth-0.10/bwameth.py", line 601, in <module> main(sys.argv[1:]) File "/nv/hp10/bin/bwa-meth-0.10/bwameth.py", line 586, in main set_as_failed=args.set_as_failed) File "/nv/hp10/bin/bwa-meth-0.10/bwameth.py", line 246, in bwa_mem raise BWAMethException("first run bwameth.py index %s" % fa) __main__.BWAMethException: first run bwameth.py index /nv/hp10/scratch/nmasked.fasta.bwameth.c2t

I'm using bwa-0.7.16a and bwa-meth-0.10 on a computing cluster running x86_64 x86_64 x86_64 GNU/Linux.

brentp commented 7 years ago

if you set reference=/path/to/some.fa then do:

bwameth.py index $reference
bwameth.py --threads 16 --reference $reference ...

then it will work. you don't pass the .c2t file.

jrmerritt6 commented 6 years ago

Thanks. When I set the path to the .fasta genome sequence, it still did not work. I got this error message:

bwameth.py --threads 16 --reference /path/refseq/nmasked.fasta DMA11392-22973-TSF-13-05-POM_S84_L001_R1_001_val_1.fq DMA11392-22973-TSF-13-05-POM_S84_L001_R2_001_val_2.fq | samtools view -b - > bwa-meth.bam

2973-TSF-13-05-POM_S84_L001_R2_001_val_2.fq | samtools view -b - > bwa-meth.bam
running: bwa mem -T 40 -B 2 -L 10 -CM -U 100 -p -R '@RG ID:DMA11392-22973-TSF-13-05-POM_S84_L001_R_001_val_ SM:DMA11392-22973-TSF-13-05-POM_S84_L001_R_001_val_' -t 16  /path/nmasked.fasta.bwameth.c2t '</usr/bin/python /path/bin/bwa-meth-0.10/bwameth.py c2t DMA11392-22973-TSF-13-05-POM_S84_L001_R1_001_val_1.fq DMA11392-22973-TSF-13-05-POM_S84_L001_R2_001_val_2.fq'
writing to:
samtools view -bS - | samtools sort - bwa-meth
[E::bwa_set_rg] the read group line contained literal <tab> characters -- replace with escaped tabs: \t
Traceback (most recent call last):
  File "/path/bin/bwa-meth-0.10/bwameth.py", line 601, in <module>
    main(sys.argv[1:])
  File "/path/bin/bwa-meth-0.10/bwameth.py", line 586, in main
    set_as_failed=args.set_as_failed)
  File "/path/bwa-meth-0.10/bwameth.py", line 259, in bwa_mem
    as_bam(cmd, fa, prefix, calmd, set_as_failed)
  File "/path/bin/bwa-meth-0.10/bwameth.py", line 293, in as_bam
    raise Exception("bad or empty fastqs")
Exception: bad or empty

Not sure what this means?

brentp commented 6 years ago

can you update to the latest bwameth.py so we are on the same version? the new version just outputs sam.

jrmerritt6 commented 6 years ago

Hi Brent, I updated to bwa-meth-0.2.0, however I get the following message:

-bash-4.1$ bwameth.py --reference /path/refseq/nmasked.fasta DMA11392-22973-TSF-13-05-POM_S84_L001_R1_001_val_1.fq DMA11392-22973-TSF-13-05-POM_S84_L001_R2_001_val_2.fq
Traceback (most recent call last):
  File "/path/bin/bwa-meth-0.2.0/bwameth.py", line 450, in <module>
    main(sys.argv[1:])
  File "/path/bin/bwa-meth-0.2.0/bwameth.py", line 432, in main
    p.add_argument('--version', action='version', version='bwa-meth.py {}'.format(__version__))

One thing I realized looking here (https://github.com/influxdata/influxdb-python/issues/288) is that I may be having issues because I'm running Python 2.6.6 due to the computing cluster I am on. Is there an adjustment I can make to bwameth.py or another version that might be compatible with 2.6.6?

brentp commented 6 years ago

I would recommend to find out if there's a module you can load on the cluster that has python2.7. If not, I would install conda in your $HOME and work with that version of python.

jrmerritt6 commented 6 years ago

I tried it on python 2.7.14 and python 3.6.1 and it worked! Thanks so much!