This is a test version of Biostars. For the public version, visit https://www.biostars.org.
I need help with bowtie2 to map reads different length

Hi, I need help mapping Paired-end samples. My samples were filtered by Prinseq. But after the filter, this error appears:

Error, fewer reads in file specified with -2 than in file specified with -1
terminate called after throwing an instance of 'int'
Aborted (core dumped)
(ERR): bowtie2-align exited with value 134

I used following command:

bowtie2 \
  --very-sensitive \
  -x 
/home/douglas_junior_lbcm/reference/S288C_reference_Modificado_index_base \
  -1 /home/douglas_junior_lbcm/analise_qualidade/amostras_filtradas/240_1_prinseq_filtered_q33_30.fastq \
  -2 
/home/douglas_junior_lbcm/analise_qualidade/amostras_filtradas/240_2_prinseq_filtered_q33_30.fastq \
  -S 240_ParInf_Q3330f_S288C_bowtie2.sam

Anyone can help me?

bowtie2

1 answer

 wc  -l /home/douglas_junior_lbcm/analise_qualidade/amostras_filtradas/240_1_prinseq_filtered_q33_30.fastq /home/douglas_junior_lbcm/analise_qualidade/amostras_filtradas/240_2_prinseq_filtered_q33_30.fastq 

should return the same number of lines for both files. Otherwise, this is a problem with the command that generated the fastq files.

26180292 /home/douglas_junior_lbcm/analise_qualidade/amostras_filtradas/240_1_prinseq_filtered_q33_30.fastq
26065868 /home/douglas_junior_lbcm/analise_qualidade/amostras_filtradas/240_2_prinseq_filtered_q33_30.fastq
52246160 total

This is the result.

The difference occurred after filtering. Do you have any suggestions on how to avoid this problem even using the same filtering parameters?

I tried to find some function to ignore different sizes of reads and I couldn't find it.

You need to use a preprocessing tool that keeps files in sync. Trimmomatic, fastp, cutadapt, to name a few.

pelo fastqc eu nao conseguiria realizar esse procedimento então? (Google Translate: "by fastqc I would not be able to perform this procedure then?")

I used following command to forward:

prinseq-lite \
  -verbose \
  -fastq /home/douglas_junior_lbcm/analise_qualidade/amostras_brutas/NG-21420_Samplen240_1.fastq \
  -out_good /home/douglas_junior_lbcm/analise_qualidade/amostras_filtradas/teste/240_1_prinseq_filtered_q33_30 \
  -trim_qual_right 33 \
  -trim_qual_window 5 \
  -trim_qual_step 1 \
  -trim_qual_type min \
  -min_len 30 \
  -out_format 3

to reverse:

prinseq-lite \
  -verbose \
  -fastq /home/douglas_junior_lbcm/analise_qualidade/amostras_brutas/NG-21420_Samplen240_1.fastq \
  -out_good /home/douglas_junior_lbcm/analise_qualidade/amostras_filtradas/teste/240_2_prinseq_filtered_q33_30 \
  -trim_qual_right 33 \
  -trim_qual_window 5 \
  -trim_qual_step 1 \
  -trim_qual_type min \
  -min_len 30 \
  -out_format 3

Both your commands seem to work on the same FASTQ file. Is that a copy-paste error?

I think the point is that this tool processes one file at a time and hence does not keeps them in sync. I gave above suggestions for alternative tools. No, fastqc cannot do any of that, it's an analysis program that "only" collects some stats.

OP is using prinseq-lite, which has a -fastq <R1> -fastq2 <R2> option for PE data. OP does not seem to pick up on the idea of processing both files "in sync" as you call it. And you're right, FASTQC's inability to process both ends together is not a problem, as nothing that FASTQC does really depends on it being able to do that.

Then use that option @OP :)

Log in to answer this question.