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 first FDA-approved CRISPR-based therapy marked the transition of therapeutic gene editing from a dream to reality1. CRISPR technologies have streamlined gene editing, and CRISPR screens have become an important approach for identifying genes involved in disease processes2. This technique introduces targeted mutations across numerous genes, enabling large-scale identification of gene functions, interactions, and pathways3. Identifying the full range...-
Channel: Articles
08-27-2024, 04:44 AM -
ad_right_rmr
Collapse
News
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by seqadmin, Yesterday, 08:02 AM
|
0 responses
10 views
0 likes
|
Last Post
by seqadmin
Yesterday, 08:02 AM
|
||
Started by seqadmin, 09-03-2024, 08:30 AM
|
0 responses
13 views
0 likes
|
Last Post
by seqadmin
09-03-2024, 08:30 AM
|
||
Started by seqadmin, 08-27-2024, 04:40 AM
|
0 responses
21 views
0 likes
|
Last Post
by seqadmin
08-27-2024, 04:40 AM
|
||
New Single-Molecule Sequencing Platform Introduces Advanced Features for High-Throughput Genomics
by seqadmin
Started by seqadmin, 08-22-2024, 05:00 AM
|
0 responses
359 views
0 likes
|
Last Post
by seqadmin
08-22-2024, 05:00 AM
|
Comment