Skip to content

Commit

Permalink
Add additional errors when passed zipped VCFs, add PRECISE/IMPRECISE …
Browse files Browse the repository at this point in the history
…flags to header
  • Loading branch information
mkirsche committed Jul 1, 2021
1 parent 0120f7a commit 00fab9c
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

JASMINE: Jointly Accurate Sv Merging with Intersample Network Edges

Version 1.1.1
Version 1.1.2

This tool is used to merge structural variants (SVs) across samples. Each sample has a number of SV calls, consisting of position information (chromosome, start, end, length), type and strand information, and a number of other values. Jasmine represents the set of all SVs across samples as a network, and uses a modified minimum spanning forest algorithm to determine the best way of merging the variants such that each merged variants represents a set of analogous variants occurring in different samples.

Expand Down
Binary file modified jasmine.jar
Binary file not shown.
Binary file modified jasmine_igv.jar
Binary file not shown.
Binary file modified jasmine_iris.jar
Binary file not shown.
Binary file modified jasmine_split.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions src/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ public class Settings {
static void usage()
{
System.out.println();
System.out.println("Jasmine version 1.1.1");
System.out.println("Jasmine version 1.1.2");
System.out.println("Usage: jasmine [args]");
System.out.println(" Example: jasmine file_list=filelist.txt out_file=out.vcf");
System.out.println();
System.out.println("Required args:");
System.out.println(" file_list (String) - a file listing paths to all variant files to use (on separate lines)");
System.out.println(" file_list (String) - a file listing paths to unzipped VCF files to merge (on separate lines)");
System.out.println(" out_file (String) - the name of the file to output the merged variants to");
System.out.println();
System.out.println("Optional args:");
Expand Down
8 changes: 8 additions & 0 deletions src/VariantInput.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ public static TreeMap<String, ArrayList<Variant>> readAllFiles(String fileList)
*/
private static TreeMap<String, ArrayList<Variant>> getSingleList(String filename, int sample) throws Exception
{
if(filename.endsWith(".gz"))
{
System.err.println("Warning: " + filename + " ends with .gz, but (b)gzipped VCFs are not accepted");
}
Scanner input = new Scanner(new FileInputStream(new File(filename)));
ArrayList<Variant> allVariants = new ArrayList<Variant>();
HashSet<String> ids = new HashSet<String>();
Expand All @@ -74,6 +78,10 @@ private static TreeMap<String, ArrayList<Variant>> getSingleList(String filename
{
continue;
}
if(line.length() >=2 && line.charAt(0) == 31 && (line.charAt(1) == 65533 || line.charAt(1) == 139))
{
throw new Exception(filename + " is a gzipped file, but only unzipped VCFs are accepted");
}
VcfEntry entry = VcfEntry.fromLine(line);
if(!previouslyMergedSamples.containsKey(sample))
{
Expand Down
3 changes: 3 additions & 0 deletions src/VariantOutput.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ else if(line.startsWith("#"))
header.addInfoField("AVG_LEN", "1", "String", "Average length for variants merged into this one");
header.addInfoField("END", "1", "String", "The end position of the variant");
header.addInfoField("SVLEN", "1", "String", "The length (in bp) of the variant");
header.addInfoField("PRECISE", "0", "Flag", "Precise structural variation");
header.addInfoField("IMPRECISE", "0", "Flag", "Imprecise structural variation");

if(Settings.ALLOW_INTRASAMPLE)
{
header.addInfoField("ALLVARS_EXT", ".", "String", "A comma-separated of all variants supporting this call");
Expand Down
4 changes: 4 additions & 0 deletions src/VcfEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ public VcfEntry(String line) throws Exception
{
originalLine = line;
tabTokens = line.split("\t");
if(line.length() >=2 && line.charAt(0) == 31 && (line.charAt(1) == 65533 || line.charAt(1) == 139))
{
throw new Exception("Trying to read a gzipped file, but only unzipped VCFs are accepted");
}
if(tabTokens.length < 8)
{
throw new Exception("VCF line had too few entries: "
Expand Down

0 comments on commit 00fab9c

Please sign in to comment.