For a specific application I need to display the 5' ends of reads in a genome browser - so far I haven't found a way to easily trim all the reads in a BAM file down to the first basepairs. I obviously need to retain mapping information so I can't just trim the reads in FASTQ.
Unconfigured Ad
Collapse
X
-
Define "retain mapping information"; do you need the information provided by the CIGARs? If you don't, such trimming is straightforward with a simple script chopping off the bases and qualities in the BAM (pipe "samtools view -h" into a script which skips over the headers, then for each line cuts down columns 10 and 11 to the desired length, and just replaces the CIGAR field with a *, piped into "samtools view -bS").
If you need to retain the information in the CIGARs properly, it becomes more messy, as you'd want to think about how to handle soft-clippings and indels.
-
Ok, so something along the lines of what's suggested in http://seqanswers.com/forums/showpos...53&postcount=2.
I don't think SeqMonk cares about the CIGAR information, so it should be fine.
Comment
-
Yes, basically. I'd really replace the CIGAR with a * though, to make the SAM/BAM file standardized. You might want to check how to decide on which side of the read sequence in the BAM is 5'/3' (in the read, not alignment sense as I understand the SAM spec) however, didn't think about that.
Comment
Latest Articles
Collapse
-
by SEQadmin2
CRISPR/Cas9 sparked the gene editing revolution for both research and therapeutics.1 But this system still showed severe issues that limited its applications. The most prominent were the heavy reliance on PAM sequences, delivery limitations, double-stranded breaks that prompt unintended edits and cell death, and editing inefficiency (both in targeting and in knock-in reliability).
Despite this, “CRISPR helped turn genome editing from a specialized technique into...-
Channel: Articles
07-31-2026, 11:01 AM -
ad_right_rmr
Collapse
News
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by SEQadmin2, Yesterday, 11:17 AM
|
0 responses
8 views
0 reactions
|
Last Post
by SEQadmin2
Yesterday, 11:17 AM
|
||
|
Started by SEQadmin2, 08-18-2026, 10:05 AM
|
0 responses
17 views
0 reactions
|
Last Post
by SEQadmin2
08-18-2026, 10:05 AM
|
||
|
Started by SEQadmin2, 08-13-2026, 12:22 PM
|
0 responses
40 views
0 reactions
|
Last Post
by SEQadmin2
08-13-2026, 12:22 PM
|
||
|
Started by SEQadmin2, 08-11-2026, 10:35 AM
|
0 responses
31 views
0 reactions
|
Last Post
by SEQadmin2
08-11-2026, 10:35 AM
|
Comment