Paired-end reads that span a position in an assembly
1
1
Entering edit mode
4.7 years ago
saladi ▴ 30

I need to find pairs of reads that span a certain position in an assembly. However, neither needs to necessarily correspond to that position. To be clear, here is an example:

assembly: ----------------------[=====================]----------------------------

pair A:   -----[<<<<<]------------------------------------[>>>>>]------------------

pair B:   -------------------------[<<<<<]------------------------[>>>>>]----------

I am interested in the positions [=====] in the assembly. I am looking for pairs of reads like read pair A. I can find reads like read pair B using bedtools intersect, but I am not interested in these.

bedtools genome assembly paired-end • 809 views
ADD COMMENT
1
Entering edit mode
4.7 years ago

using samjdk. http://lindenb.github.io/jvarkit/SamJdk.html Say you want spanning RF01:1000-2000.

samtools view -u S1.bam RF01 | java -jar dist/samjdk.jar -e 'if(record.getReadUnmappedFlag() || !record.getReadPairedFlag() || record.getMateUnmappedFlag() || !record.getContig().equals(record.getMateReferenceName()) || !record.getContig().equals("RF01")) return false;  return(Math.min(record.getStart(),record.getMateAlignmentStart()) < 1000 && Math.max(record.getStart(),record.getMateAlignmentStart())>2000) ;'
ADD COMMENT

Login before adding your answer.

Traffic: 2067 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6