Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • Adding GT tag to Strelka Output

    Does anyone know of a way to add the GT tag to the VCF output of Strelka? There is a SGT tag, described as "Most likely somatic genotype excluding normal noise states," but it is not in the typical GT format. Maybe there is a program that will convert it to GT format?

    Thanks,
    Erich

  • #2
    I came across this issue while trying to run Annovar on Strelka2 output.
    Annovar throws an error without the GT tag so I did the following at the command line to add in GT information:

    Set filenames
    Code:
    strelka_output_file="somatic.indels.passed.vcf"
    strelka_mod="somatic.indels.passed.GTmod.vcf"
    Add GT FORMAT in VCF header
    Find the first ##FORMAT line in header
    grep for the line "n"umber and only 1 "m"atch
    sed with a leading "number"i will insert into the file at the specified line. e.g. Leading 8i will insert at 8th line.
    Code:
    first_format_num=$(grep -n -m 1 '##FORMAT' "$strelka_output_file" | cut -d : -f 1)
    sed "$first_format_num"'i##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype">' "$strelka_output_file" > "$strelka_mod"
    Use sed with extended "r"egular expression support to edit "i"nplace
    All lines of my strelka output have the format string BCN50PP2P50:FDP50:SUBDP50:TAR:TIR:TOR
    Find BCN50, prepend "GT:" then replace BCN50 with \1 capture group
    Find tab following TOR, and prepend 0/0 for Normal
    From the same TOR starting point, match anything except tabs. Prepend 0/1 for tumor
    Code:
    sed -ri 's|(BCN50:)|GT:\1|g' "$strelka_mod"
    sed -ri 's|(:TOR\t)|\10/0:|g' "$strelka_mod"
    sed -ri 's|(:TOR\t[^\t]*\t)|\10/1:|g' "$strelka_mod"

    This changes the lines of strelka output from this:
    Code:
    chr1	803750	.	TA	T	.	PASS	IC=10;IHP=12;MQ=54.88;MQ0=0;NT=ref;QSI=35;QSI_NT=35;RC=11;RU=A;SGT=ref->het;SOMATIC;SomaticEVS=6.65;TQSI=2;TQSI_NT=2	BCN50:DP:DP2:DP50:FDP50:SUBDP50:TAR:TIR:TOR	0.06:38:38:35.07:2.02:0.00:31,40:0,0:7,4	0.09:25:25:23.33:2.12:0.00:17,22:4,4:4,2
    To this:
    Code:
    chr1	803750	.	TA	T	.	PASS	IC=10;IHP=12;MQ=54.88;MQ0=0;NT=ref;QSI=35;QSI_NT=35;RC=11;RU=A;SGT=ref->het;SOMATIC;SomaticEVS=6.65;TQSI=2;TQSI_NT=2	[B]GT:[/B]BCN50:DP:DP2:DP50:FDP50:SUBDP50:TAR:TIR:TOR	[B]0/0:[/B]0.06:38:38:35.07:2.02:0.00:31,40:0,0:7,4	[B]0/1:[/B]0.09:25:25:23.33:2.12:0.00:17,22:4,4:4,2

    Admittedly, the 0/0 and 0/1 inserted aren't necessarily accurately representing homozygous / heterozygous status, but it was enough to get Annovar to run.

    Comment


    • #3
      I came across this issue while trying to run Annovar on Strelka2 output.
      Annovar throws an error without the GT tag so I did the following at the command line to add in GT information:

      Set filenames
      Code:
      strelka_output_file="somatic.indels.passed.vcf"
      strelka_mod="somatic.indels.passed.GTmod.vcf"
      Add GT FORMAT in VCF header
      Find the first ##FORMAT line in header
      grep for the line "n"umber and only 1 "m"atch
      sed with a leading "number"i will insert into the file at the specified line. e.g. Leading 8i will insert at 8th line.
      Code:
      first_format_num=$(grep -n -m 1 '##FORMAT' "$strelka_output_file" | cut -d : -f 1)
      sed "$first_format_num"'i##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype">' "$strelka_output_file" > "$strelka_mod"
      Use sed with extended "r"egular expression support to edit "i"nplace
      All lines of my strelka output have the format string BCN50PP2P50:FDP50:SUBDP50:TAR:TIR:TOR
      Find BCN50, prepend "GT:" then replace BCN50 with \1 capture group
      Find tab following TOR, and prepend 0/0 for Normal
      From the same TOR starting point, match anything except tabs. Prepend 0/1 for tumor
      Code:
      sed -ri 's|(BCN50:)|GT:\1|g' "$strelka_mod"
      sed -ri 's|(:TOR\t)|\10/0:|g' "$strelka_mod"
      sed -ri 's|(:TOR\t[^\t]*\t)|\10/1:|g' "$strelka_mod"

      This changes the lines of strelka output from this:
      Code:
      chr1	803750	.	TA	T	.	PASS	IC=10;IHP=12;MQ=54.88;MQ0=0;NT=ref;QSI=35;QSI_NT=35;RC=11;RU=A;SGT=ref->het;SOMATIC;SomaticEVS=6.65;TQSI=2;TQSI_NT=2	BCN50:DP:DP2:DP50:FDP50:SUBDP50:TAR:TIR:TOR	0.06:38:38:35.07:2.02:0.00:31,40:0,0:7,4	0.09:25:25:23.33:2.12:0.00:17,22:4,4:4,2
      To this:
      Code:
      chr1	803750	.	TA	T	.	PASS	IC=10;IHP=12;MQ=54.88;MQ0=0;NT=ref;QSI=35;QSI_NT=35;RC=11;RU=A;SGT=ref->het;SOMATIC;SomaticEVS=6.65;TQSI=2;TQSI_NT=2	[B]GT:[/B]BCN50:DP:DP2:DP50:FDP50:SUBDP50:TAR:TIR:TOR	[B]0/0:[/B]0.06:38:38:35.07:2.02:0.00:31,40:0,0:7,4	[B]0/1:[/B]0.09:25:25:23.33:2.12:0.00:17,22:4,4:4,2

      Admittedly, the 0/0 and 0/1 inserted aren't necessarily accurately representing homozygous / heterozygous status, but it was enough to get Annovar to run.

      Comment

      Latest Articles

      Collapse

      • seqadmin
        Recent Advances in Sequencing Analysis Tools
        by seqadmin


        The sequencing world is rapidly changing due to declining costs, enhanced accuracies, and the advent of newer, cutting-edge instruments. Equally important to these developments are improvements in sequencing analysis, a process that converts vast amounts of raw data into a comprehensible and meaningful form. This complex task requires expertise and the right analysis tools. In this article, we highlight the progress and innovation in sequencing analysis by reviewing several of the...
        Today, 07:48 AM
      • seqadmin
        Essential Discoveries and Tools in Epitranscriptomics
        by seqadmin




        The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
        04-22-2024, 07:01 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by seqadmin, Today, 07:17 AM
      0 responses
      11 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 05-02-2024, 08:06 AM
      0 responses
      19 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-30-2024, 12:17 PM
      0 responses
      20 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-29-2024, 10:49 AM
      0 responses
      28 views
      0 likes
      Last Post seqadmin  
      Working...
      X