chengyuan / reago-1.1

19 stars 12 forks source link

filter_input.py key error #9

Open spaver opened 8 years ago

spaver commented 8 years ago

When I run filter_input.py, I get the the following KeyError: Metagenome1 (error surfaced relatively quickly): Indentifying 16S reads Traceback (most recent call last): File "/Users/spaver/bin/reago-1.1-master/filter_input.py", line 171, in seq_1 = db_1[read_id_1] KeyError: 'M01979:34:000000000-AKYTJ:1:2106:19462:22141' Metagenome2 (error surfaced after hours of running): Traceback (most recent call last): File "/Users/spaver/bin/reago-1.1-master/filter_input.py", line 171, in seq_1 = db_1[read_id_1] KeyError: 'M01979:34:000000000-AKYTJ:1:1118:21275:2969'

Szymonome commented 7 years ago

You have to change names of the reads, use this: for ((n=1; n<=5; n++)); do sed "s/ 1:.:0:[ATCG]$/.1/" Sample_R1.fasta > Sample_R1_rename.fasta; sed "s/ 2:.:0:[ATCG]$/.2/" Sample_R2.fasta > Sample_R2.rename.fasta; done

xsharkbaitx commented 6 years ago

I just ran into the same error. Tried to use the suggestion, but, command did not change the files. Entered "for ((n=1; n<=5; n++)); do sed "s/ 1:.:0:[ATCG]$/.1/" Sample_R1.fasta > Sample_R1_rename.fasta; sed "s/ 2:.:0:[ATCG]$/.2/" Sample_R2.fasta > Sample_R2.rename.fasta; done" with my own file names. Any help would be appreciated.

Leitemfa commented 5 years ago

Hello,

I also found a similar error when running this function in my snakemake file, see below:

Traceback (most recent call last): File "/mnt/nfs/bioinfdata/ngs/ME/kuramae_group/marcio/AtlasNitrospira/binningMarcio/shotgun-workflow-MiSeq/analysis/.snakemake/conda/be0a5744/bin/filter_input.py", line 173, in <module> seq_1 = db_1[read_id_1] KeyError: 'M00833:599:000000000-BFN38:1:1105:5905:15364'

Any suggestion on how to solve it?

Kind regards, Marcio

Leitemfa commented 5 years ago

Is the name of the file really an issue here? One of my files, for example, is named Index_9.11_06_C1. What is wrong if the name of a file like that?

Leitemfa commented 5 years ago

Hi, after I while I managed to add a rule in snakemake to rename the files

rule rename_reago: input: fileF="{project}/truncated.{sample}_1.fasta", fileR="{project}/truncated.{sample}_2.fasta" output: fileF="{project}/truncated.{sample}_1_rename.fasta", fileR="{project}/truncated.{sample}_2_rename.fasta" conda: "envs/reago.yaml" shell: """for ((n=1; n<=5; n++));""" """do sed "s/ 1:.:0:[ATCG]$/.1/" {input.fileF} > {output.fileF}; """ """ sed "s/ 2:.:0:[ATCG]$/.2/" {input.fileR} > {output.fileR};""" """done"""

However, even after doing all that I keep receiving the same error message:

Traceback (most recent call last): File "/mnt/nfs/bioinfdata/ngs/ME/kuramae_group/marcio/AtlasNitrospira/binningMarcio/shotgun-workflow-MiSeq/analysis/.snakemake/conda/be0a5744/bin/filter_input.py", line 173, in <module> seq_1 = db_1[read_id_1] KeyError: 'M00833:599:000000000-BFN38:1:1105:5905:15364'

Any idea on how to solve that?

Thanks in advance

Tahsin-Khan commented 4 years ago

Hi,

I am also facing problems running the filter_input.py.

The code I used was "python filter_input.py output_forward_R1.fasta output_reverse_R2.fasta filtered_reads /home/z5181848/scratch/reago/reago-1.1/cm ab 4"

and I get this message "sh: cmsearch: command not found sh: cmsearch: command not found sh: cmsearch: command not found sh: cmsearch: command not found"

Can anyone suggest the reason for this and how to make it work?

Thanks in advance.

MonicaSteffi commented 2 years ago

You have to install infernal https://github.com/EddyRivasLab/infernal

conda install -c bioconda infernal=1.1.2