Question: tool for a pattern of repeats
0
gravatar for 2nelly
10 months ago by
2nelly120
Athens
2nelly120 wrote:

Dear all,

I am wondering if there is any tool or someone have a custom script to extract reads from sam/bam or fastq file that contain a specific pattern of repeats. Let s say we have 1000000 reads and we want to look how many of them contain the pattern (CCAATT)n.

Thank you in advance.

sequencing sequence • 256 views
ADD COMMENTlink modified 10 months ago by Pierre Lindenbaum106k • written 10 months ago by 2nelly120
2
gravatar for Pierre Lindenbaum
10 months ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum106k wrote:

using samjs: http://lindenb.github.io/jvarkit/SamJavascript.html

java -jar dist/samjs.jar -e 'record.getReadString().contains("CCAATT") || record.getReadString().contains("GGTTAA")'  input.bam

using awk:

samtools view -h input.bam | awk -F '\t'  '($0 ~ /^@/ || $10 ~ /CCAATT/ || $10 ~ /AATTGG/ )'

from a fastq:

  gunzip -c input.fastq.gz | paste - - - - | awk  -F '\t'  '($2 ~ /CCAATT/ || $2 ~ /AATTGG/ )' | tr "\t" "\n"
ADD COMMENTlink written 10 months ago by Pierre Lindenbaum106k

Thank you so much Pierre!

You are always there when we need help.

I will give a try to all of these commands

ADD REPLYlink written 10 months ago by 2nelly120

You've asked many questions on this forum without validation (green mark on the left) or comment. e.g: samtools flagstat only for exome coordinates . Please validate/close the answers.

ADD REPLYlink modified 10 months ago • written 10 months ago by Pierre Lindenbaum106k

Dear Pierre,

These commands are working nicely.

However, what about if we want to look for reads consisting of let s say more than 50% of this repeat (randomly distributed within the reads)?

many thanks

ADD REPLYlink modified 10 months ago • written 10 months ago by 2nelly120
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1113 users visited in the last hour