/usr/share/doc/libbiojava-java-demos/examples/biosql/DummyFromGFF.java is in libbiojava-java-demos 1:1.7.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | package biosql;
import java.io.*;
import java.util.*;
import org.biojava.bio.*;
import org.biojava.bio.seq.*;
import org.biojava.bio.seq.db.*;
import org.biojava.bio.seq.db.biosql.*;
import org.biojava.bio.symbol.*;
import org.biojava.bio.program.gff.*;
public class DummyFromGFF {
public static void main(String[] args)
throws Exception
{
String dbURL = "jdbc:postgresql://localhost/thomasd_biosql2";
String dbUser = "thomas";
String dbPass = "";
String bioName = "testing";
BioSQLSequenceDB bssdb = new BioSQLSequenceDB(dbURL,
dbUser,
dbPass,
bioName,
true);
String seqID = args[0];
int length = Integer.parseInt(args[1]);
String gffFile = args[2];
bssdb.createDummySequence(seqID, DNATools.getDNA(), length);
Sequence dummy = bssdb.getSequence(seqID);
GFFEntrySet gff = loadGFF(gffFile);
gff.getAnnotator().annotate(dummy);
}
public static GFFEntrySet loadGFF(String name)
throws Exception
{
GFFParser gffp = new GFFParser();
BufferedReader gff = new BufferedReader(new FileReader(name));
GFFEntrySet set = new GFFEntrySet();
gffp.parse(gff, set.getAddHandler(), name);
return set;
}
}
|