This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Seq Reads Trimming

I have sequencing data which I want to trim from 3' end to retain first 20 bp not on based on quality. Most of the tools ask for qulaity and and then trim. Is there any way I can just trim reads to keep first 20 bases. This data is for matching bar codes with standard format which is embedded in first 20 bp.

Thanks

trimming quality

2 answers

Fastx has a trimmer option, which is doing exactly that.

FASTA/Q Trimmer

$ fastx_trimmer -h
usage: fastx_trimmer [-h] [-f N] [-l N] [-z] [-v] [-i INFILE] [-o OUTFILE]

version 0.0.6
   [-h]         = This helpful help screen.
   [-f N]       = First base to keep. Default is 1 (=first base).
   [-l N]       = Last base to keep. Default is entire read.
   [-z]         = Compress output with GZIP.
   [-i INFILE]  = FASTA/Q input file. default is STDIN.
   [-o OUTFILE] = FASTA/Q output file. default is STDOUT.

When I tried to use FASTx it is asking for quality score.

Maybe you used fastq_quality trimmer instead of fastx_trimmer? Because as you can see from the help output above, it does not need any quality threshold.

Add the option -Q 33 like that: fastx_trimmer -i Sample.fastq -o Sample_trimmed.fastq -f 5 -Q 33

You can use a simple perl script which can do this job for you. You can use the substr() function to extract the first 20 base pairs alone..

For example you can say

$seq1= substr($seq, 20);

Hope this would help you!!

Log in to answer this question.