Skip to content

Commit

Permalink
Add GSGT, remove IYG autodetection
Browse files Browse the repository at this point in the history
Add GSGT similar to IYG
Remove IYG autodetection as they differ with the added GSGT format
  • Loading branch information
teepean authored May 8, 2019
1 parent a699caf commit 19f815b
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ class Program
public const int TYPE_EIGENSTRAT = 6;
public const int TYPE_FTDNA2 = 7;
public const int TYPE_IYG = 8;
public const int TYPE_GSGT = 9;

public static string[] TYPE = { "ftdna", "23andme", "ancestry", "decodeme", "geno2", "plink", "eigenstrat", "ftdna2", "iyg" };
public static string[] TYPE = { "ftdna", "23andme", "ancestry", "decodeme", "geno2", "plink", "eigenstrat", "ftdna2", "iyg", "gsgt" };

public static void printLogo()
{
Expand All @@ -29,7 +30,7 @@ public static void printLogo()
Console.WriteLine("| Website: www.y-str.org |");
Console.WriteLine("| Developer: Felix Immanuel <[email protected]> |");
Console.WriteLine("| Version: 1.8 |");
Console.WriteLine("| Build Date: 10-Apr-2019 |");
Console.WriteLine("| Build Date: 8-May-2019 |");
Console.WriteLine("+-------------------------------------------+");
}

Expand All @@ -40,7 +41,7 @@ public static void printSyntax()
Console.WriteLine("\taconv <in-file> <out-file> [options]");
Console.WriteLine();
Console.WriteLine("Optional Parameters:");
Console.WriteLine(" -i [Input Type] - Value can be detect,ftdna,ftdna2,23andme,decodeme,ancestry, eigenstrat, iyg or geno2. ");
Console.WriteLine(" -i [Input Type] - Value can be detect,ftdna,ftdna2,23andme,decodeme,ancestry, eigenstrat, iyg, gsgt or geno2. ");
Console.WriteLine(" This values is optional and not required. Use only if ");
Console.WriteLine(" autodetect fails. Default is detect");
Console.WriteLine(" -o [Output Type] - Value can be ftdna,23andme,ancestry,geno2, plink or eigenstrat.");
Expand Down Expand Up @@ -111,6 +112,8 @@ static void Main(string[] args)
in_type = TYPE_EIGENSTRAT;
else if (args[i + 1].ToLower() == "iyg")
in_type = TYPE_IYG;
else if (args[i + 1].ToLower() == "gsgt")
in_type = TYPE_GSGT;
}
if (args[i] == "-o")
{
Expand Down Expand Up @@ -337,6 +340,19 @@ private static int updateMasterSNPlist(string infile,string outfile, int intype,
pos = data[3];
genotype = data[6] + data[7];
}
if (intype == TYPE_GSGT)
{
if (line.StartsWith("Sample ID,") || line.StartsWith("[") || line.StartsWith("GSGT") || line.StartsWith("Processing") || line.StartsWith("Content") || line.StartsWith("Num") || line.StartsWith("Total") || line.StartsWith("File") || line.Trim() == "")
{
continue;
}
data = line.Split(",".ToCharArray());

rsid = data[4];
chr = data[1];
pos = data[2];
genotype = data[7] + data[8];
}
//rows.Add(new string[]{rsid,chr,pos,genotype});

if (outtype == TYPE_FTDNA)
Expand Down Expand Up @@ -495,8 +511,8 @@ private static int detectDNAFileType(IEnumerable<string> lines)
return TYPE_DECODEME;
if (line == "SNP,Chr,Allele1,Allele2")
return TYPE_GENO2;
if (line == "[Header]")
return TYPE_IYG;
// if (line == "[Header]")
// return TYPE_IYG;

/* if above doesn't work */
if (line.Split("\t".ToCharArray()).Length == 4)
Expand Down

0 comments on commit 19f815b

Please sign in to comment.