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

    • SEQadmin2
      Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
      by SEQadmin2



      Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

      Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
      ...
      10-14-2026, 09:55 AM
    • SEQadmin2
      New Genomics Technologies Take Aim at Long-Standing Limits
      by SEQadmin2


      Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

      We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
      ...
      09-28-2026, 10:25 AM

    ad_right_rmr

    Collapse

    News

    Collapse

    Topics Statistics Last Post
    Started by SEQadmin2, 10-22-2026, 11:13 AM
    0 responses
    27 views
    0 reactions
    Last Post SEQadmin2  
    Started by SEQadmin2, 10-22-2026, 10:48 AM
    0 responses
    20 views
    0 reactions
    Last Post SEQadmin2  
    Started by SEQadmin2, 10-15-2026, 10:52 AM
    0 responses
    36 views
    0 reactions
    Last Post SEQadmin2  
    Started by SEQadmin2, 10-14-2026, 05:39 AM
    0 responses
    43 views
    0 reactions
    Last Post SEQadmin2  
    Working...