JAL-3641 allow protocol to be configured at top of script features/JAL-3641_phredfromfastq
authorJim Procter <jprocter@issues.jalview.org>
Mon, 8 Jun 2020 10:22:36 +0000 (11:22 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Mon, 8 Jun 2020 10:22:36 +0000 (11:22 +0100)
examples/groovy/FastQParser.groovy

index 7658539..8414e54 100644 (file)
@@ -18,9 +18,9 @@ import jalview.io.DataSourceType
 /*
  * EDIT THE FILE PATH BELOW TO IMPORT A FASTQ FILE
  */
-FASTQ_FILE = "/Users/jprocter/Downloads/small_normalised_illumina_adeno.fastq.gz"
-FASTQ_FILE = "/Users/jprocter/Downloads/test.fastq"
 
+FASTQ_FILE = "/Users/jprocter/Downloads/test.fastq"
+FASTQ_FILE_PROTOCOL = DataSourceType.FILE // could also be DataSourceType.URL
 
 /*
  * A parser class to read or write the format
@@ -135,7 +135,7 @@ def myFormat = { ->
 
 // read in the file specified at the top of the Groovy script
 
-FastQFile parser = new FastQFile(new FileParse(FASTQ_FILE, DataSourceType.FILE));
+FastQFile parser = new FastQFile(new FileParse(FASTQ_FILE, FASTQ_FILE_PROTOCOL));
 AlignmentI al = new jalview.datamodel.Alignment(parser.getSeqsAsArray());
 parser.addAnnotations(al);
 jalview.gui.AlignFrame newwindow = new jalview.gui.AlignFrame(al,800,600);