Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #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

    • seqadmin
      Strategies for Sequencing Challenging Samples
      by seqadmin


      Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
      03-22-2024, 06:39 AM
    • seqadmin
      Techniques and Challenges in Conservation Genomics
      by seqadmin



      The field of conservation genomics centers on applying genomics technologies in support of conservation efforts and the preservation of biodiversity. This article features interviews with two researchers who showcase their innovative work and highlight the current state and future of conservation genomics.

      Avian Conservation
      Matthew DeSaix, a recent doctoral graduate from Kristen Ruegg’s lab at The University of Colorado, shared that most of his research...
      03-08-2024, 10:41 AM

    ad_right_rmr

    Collapse

    News

    Collapse

    Topics Statistics Last Post
    Started by seqadmin, Yesterday, 06:37 PM
    0 responses
    8 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, Yesterday, 06:07 PM
    0 responses
    8 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, 03-22-2024, 10:03 AM
    0 responses
    49 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, 03-21-2024, 07:32 AM
    0 responses
    67 views
    0 likes
    Last Post seqadmin  
    Working...
    X