blob: df57fbcfc2d6479a6592f4ccc7a5f199f8073a25 [file] [log] [blame]
{
"http://purl.org/dc/terms/rights": "Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the 'License'); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.",
"http://purl.org/dc/terms/license": {"@id": "http://www.apache.org/licenses/LICENSE-2.0"},
"classLoaderSharing" : "workflow",
"script" : "import org.biojava.bio.seq.Sequence;\nimport org.biojava.bio.seq.SequenceIterator;\nimport org.biojava.bio.seq.io.SeqIOTools;\nimport org.biojava.bio.seq.io.agave.AgaveWriter;\n\nBufferedReader getReader (String fileUrl) throws IOException {\n\t\tInputStreamReader reader;\n\t\ttry {\n\t\t\treader = new FileReader(fileUrl);\n\t\t}\n\t\tcatch (FileNotFoundException e) {\n\t\t\t// try a real URL instead\n\t\t\tURL url = new URL(fileUrl);\n\t\t\treader = new InputStreamReader (url.openStream());\n\t\t}\n\t\treturn new BufferedReader(reader);\n\t}\n\nif ((fileUrl == void) || (fileUrl == null)) {\n throw new RuntimeException(\"The fileUrl must be specified\");\n}\n\nBufferedReader br = getReader(fileUrl);\n\n// read the GenBank File\nSequenceIterator sequences = SeqIOTools.readGenbank(br);\n\n// iterate through the sequences\nByteArrayOutputStream os = new ByteArrayOutputStream();\nStringBuffer sb = new StringBuffer();\nAgaveWriter writer = new AgaveWriter();\nPrintStream ps = new PrintStream(os);\n\nwhile (sequences.hasNext()) {\n\tSequence seq = sequences.nextSequence();\n\twriter.writeSequence(seq, ps);\n\tsb.append(os.toString());\n}\n\ngenbankdata = sb.toString();\nbr.close();\nps.close();\n \n",
"localworkerName" : "net.sourceforge.taverna.scuflworkers.biojava.GenBankParserWorker",
"inputPorts" : [ {
"name" : "fileUrl",
"depth" : 0,
"type" : "String"
} ],
"outputPorts" : [ {
"name" : "genbankdata",
"depth" : 0,
"granularDepth" : 0
} ],
"isAltered" : false
}