I have a bam file and I’d like to retrieve the part of sequence of each reads that aligns to a certain region in the reference. For example, for reads that cover region chr1:1000-1100, I need to clip them such that only the part aligning to this region remains. The output should be reads that align exactly at this particular region, with all the flanking sequences clipped. Is there any tools available to do this? Thanks.
Seqanswers Leaderboard Ad
Collapse
Announcement
Collapse
No announcement yet.
X
-
It's best to do something like this in python or another language, at least if you have any indels. The general idea is to extract the reads covering that regions (with samtools), extract the start position, parse the CIGAR to determine the position of each nucleotide in the read, output nucleotides in the position of interest.
@TiborNagy, that won't actually do what shiningway wants. If a read is AAACCTGACTGATCGAC and only the last 8 bases overlap the region, then the output for that read should be TGATCGAC.
Comment
-
I was hoping to find existing tools to do this. But it seems I have to write it myself. Thanks.
Originally posted by dpryan View PostIt's best to do something like this in python or another language, at least if you have any indels. The general idea is to extract the reads covering that regions (with samtools), extract the start position, parse the CIGAR to determine the position of each nucleotide in the read, output nucleotides in the position of interest.
@TiborNagy, that won't actually do what shiningway wants. If a read is AAACCTGACTGATCGAC and only the last 8 bases overlap the region, then the output for that read should be TGATCGAC.
Comment
Latest Articles
Collapse
-
by seqadmin
The complexity of cancer is clearly demonstrated in the diverse ecosystem of the tumor microenvironment (TME). The TME is made up of numerous cell types and its development begins with the changes that happen during oncogenesis. “Genomic mutations, copy number changes, epigenetic alterations, and alternative gene expression occur to varying degrees within the affected tumor cells,” explained Andrea O’Hara, Ph.D., Strategic Technical Specialist at Azenta. “As...-
Channel: Articles
07-08-2024, 03:19 PM -
ad_right_rmr
Collapse
News
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by seqadmin, Yesterday, 06:46 AM
|
0 responses
9 views
0 likes
|
Last Post
by seqadmin
Yesterday, 06:46 AM
|
||
Started by seqadmin, 07-24-2024, 11:09 AM
|
0 responses
26 views
0 likes
|
Last Post
by seqadmin
07-24-2024, 11:09 AM
|
||
Started by seqadmin, 07-19-2024, 07:20 AM
|
0 responses
160 views
0 likes
|
Last Post
by seqadmin
07-19-2024, 07:20 AM
|
||
Started by seqadmin, 07-16-2024, 05:49 AM
|
0 responses
127 views
0 likes
|
Last Post
by seqadmin
07-16-2024, 05:49 AM
|
Comment