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

bwameth set_as_failed=args.set_as_failed #44

Open
jrmerritt6 opened this issue Oct 4, 2017 · 6 comments
Open

bwameth set_as_failed=args.set_as_failed #44

jrmerritt6 opened this issue Oct 4, 2017 · 6 comments

Comments

@jrmerritt6
Copy link

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
Copy link
Owner

brentp commented Oct 4, 2017

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
Copy link
Author

jrmerritt6 commented Oct 5, 2017

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
Copy link
Owner

brentp commented Oct 5, 2017

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

@jrmerritt6
Copy link
Author

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 (influxdata/influxdb-python#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
Copy link
Owner

brentp commented Oct 6, 2017

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
Copy link
Author

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

nsoranzo added a commit to nsoranzo/bwa-meth that referenced this issue Nov 3, 2017
When using bwameth with bwa >=0.7.16 and not specifying `--read-group`,
I'm getting the error already reported in

brentp#44 (comment)

i.e.:

```
[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
```

This is due to the following change in bwa:

xref. lh3/bwa#84
nsoranzo added a commit to nsoranzo/bwa-meth that referenced this issue Nov 3, 2017
When using bwameth with bwa >=0.7.16 and not specifying `--read-group`,
I'm getting the error already reported in

brentp#44 (comment)

i.e.:

```
[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
```

This is due to the following change in bwa:

lh3/bwa#84
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

No branches or pull requests

2 participants