Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • frymor
    Senior Member
    • May 2010
    • 151

    #1

    junction bed file from STAR

    Hi everybody,

    I am trying to create a junction file from the SJ.out.tab file of the STAR aligner.
    I would like to see only those alignment in there, which have at least 5 reads covering the junction for canonical motives and 8 reads for non-canonical.

    To get the reads I have used the following parameters:
    Code:
    --outFilterType BySJout
    --outSJfilterCountTotalMin 10 8 8 8 
    --outSJfilterReads default: All
    --outSJfilterOverhangMin 30 12 12 12
    --alignSJoverhangMin 8 
    --alignSJDBoverhangMin 5
    --outFilterMultimapNmax 20
    I have than run STAR and modify the SJ.out.tab file in the following way:

    Code:
    awk {'if($4=="2") print "chr"$1"\t"$2-$9"\t"$3+$9"\tJUNC000"NR"\t"$7+$8"\t-\t"$2-$9"\t"$3+$9"\t255,0,0\t2\t"$9","$9"\t","0,"$3-$2+$9; else if($4=="1") print "chr"$1"\t"$2-$9"\t"$3+$9"\tJUNC000"NR"\t"$7+$8"\t+\t"$2-$9"\t"$3+$9"\t0,0,255\t2\t"$9","$9"\t","0,"$3-$2+$9'} $file >> $NEW
    so that I get a bed file structure.

    Code:
    track name="IFM16h_1.bed" description="IFM16h_1.STAR.SJ.out.tab" visibility=2 useScore=1
    chr2L	8082	8227	JUNC0001	26	+	8082	8227	0,0,255	2	35,35	 0,110
    chr2L	8105	8240	JUNC0002	1	+	8105	8240	0,0,255	2	12,12	 0,123
    chr2L	11330	11424	JUNC0003	2	-	11330	11424	255,0,0	2	15,15	 0,79
    But even though I have tried everything to set a threshold for the "score" (the columns 7 and 8 of the original SJ.out.tab file, $7 and $8 in the awk command) greater than 1 I still get the in my junction file.

    I would like to know if there is a way of making sure, that only splice junction with a coverage >=5 (or 8 ) will be in the SJ.out.tab file.

    Does it means that the junctions with a coverage below 5 are annotated junctions? (If I understand the parameters correctly)

    Thanks

    Assa
  • krespim
    Member
    • Jul 2012
    • 49

    #2
    Originally posted by frymor View Post
    Hi everybody,

    I am trying to create a junction file from the SJ.out.tab file of the STAR aligner.
    I would like to see only those alignment in there, which have at least 5 reads covering the junction for canonical motives and 8 reads for non-canonical.

    To get the reads I have used the following parameters:
    Code:
    --outFilterType BySJout
    --outSJfilterCountTotalMin 10 8 8 8 
    --outSJfilterReads default: All
    --outSJfilterOverhangMin 30 12 12 12
    --alignSJoverhangMin 8 
    --alignSJDBoverhangMin 5
    --outFilterMultimapNmax 20
    I have than run STAR and modify the SJ.out.tab file in the following way:

    Code:
    awk {'if($4=="2") print "chr"$1"\t"$2-$9"\t"$3+$9"\tJUNC000"NR"\t"$7+$8"\t-\t"$2-$9"\t"$3+$9"\t255,0,0\t2\t"$9","$9"\t","0,"$3-$2+$9; else if($4=="1") print "chr"$1"\t"$2-$9"\t"$3+$9"\tJUNC000"NR"\t"$7+$8"\t+\t"$2-$9"\t"$3+$9"\t0,0,255\t2\t"$9","$9"\t","0,"$3-$2+$9'} $file >> $NEW
    so that I get a bed file structure.

    Code:
    track name="IFM16h_1.bed" description="IFM16h_1.STAR.SJ.out.tab" visibility=2 useScore=1
    chr2L	8082	8227	JUNC0001	26	+	8082	8227	0,0,255	2	35,35	 0,110
    chr2L	8105	8240	JUNC0002	1	+	8105	8240	0,0,255	2	12,12	 0,123
    chr2L	11330	11424	JUNC0003	2	-	11330	11424	255,0,0	2	15,15	 0,79
    But even though I have tried everything to set a threshold for the "score" (the columns 7 and 8 of the original SJ.out.tab file, $7 and $8 in the awk command) greater than 1 I still get the in my junction file.

    I would like to know if there is a way of making sure, that only splice junction with a coverage >=5 (or 8 ) will be in the SJ.out.tab file.

    Does it means that the junctions with a coverage below 5 are annotated junctions? (If I understand the parameters correctly)

    Thanks

    Assa

    Hi Assa,

    if I understood you properly the issue is that you can't filter out junctions with less than N reads (let's say N = 5) from the junction files. You can do it with awk before the junction file is even created:

    Code:
    awk '{if ($7 > 6) print $0}' $file
    The condition {if ($5 > 6) print $0}' can be modified to include all sort of things, including the type site (canonical vs non-canonical)

    Code:
    awk '{if ($7 > 6 & $5 == 0) print $0}' $file
    and variations of thereof. Also be careful that the SJ.out.tab is one-based and bed files are zero based. So in the output of your awk command the 3' of the 1st exon is actually the first 5' base of the intron. See this for a better explanation.

    Comment

    Latest Articles

    Collapse

    • kinpict.com
      Reply to 16S/ITS Profiling vs. Shotgun Metagenomics: What Changes in Your Workflow?
      by kinpict.com
      The part about this topic feels surprisingly grounded, and the details on the page is the bit that made me slow down. I’d keep <a href="https://kinpict.com/">ai family photo generator</a> bookmarked for later.
      Yesterday, 06:37 PM
    • SEQadmin2
      16S/ITS Profiling vs. Shotgun Metagenomics: What Changes in Your Workflow?
      by SEQadmin2





      NGS has revolutionized clinical microbiology by offering new ways to identify and surveil pathogens without prior knowledge of the target. One popular approach is 16S rRNA and ITS amplicon sequencing, which targets specific microbial markers. But studies are increasingly incorporating shotgun metagenomics, a technique that sequences all DNA from a sample without targeting specific microbial markers. This approach allows more detailed taxonomic classification,...
      10-30-2026, 06:46 AM

    ad_right_rmr

    Collapse

    News

    Collapse

    Topics Statistics Last Post
    Started by SEQadmin2, 11-12-2026, 07:59 AM
    0 responses
    29 views
    0 reactions
    Last Post SEQadmin2  
    Started by SEQadmin2, 11-05-2026, 09:25 AM
    0 responses
    36 views
    0 reactions
    Last Post SEQadmin2  
    Started by SEQadmin2, 11-03-2026, 11:54 AM
    2 responses
    59 views
    0 reactions
    Last Post kinpict.com  
    Started by SEQadmin2, 10-28-2026, 09:57 AM
    0 responses
    176 views
    0 reactions
    Last Post SEQadmin2  
    Working...