Skip to content
Snippets Groups Projects
Commit f3c18d0c authored by tcarver's avatar tcarver
Browse files

optionally remove products from pseudogenes

parent 818e10ff
No related branches found
No related tags found
No related merge requests found
...@@ -471,7 +471,7 @@ public class EntryFileDialog extends StickyFileChooser ...@@ -471,7 +471,7 @@ public class EntryFileDialog extends StickyFileChooser
ReadAndWriteEntry.writeDatabaseEntryToFile(entry, file, ReadAndWriteEntry.writeDatabaseEntryToFile(entry, file,
flattenGeneModel.isSelected(), flattenGeneModel.isSelected(),
ignoreObsoleteFeatures.isSelected(), false, ignoreObsoleteFeatures.isSelected(), false,
include_diana_extensions, destination_type, owner); include_diana_extensions, false, destination_type, owner);
else if(include_diana_extensions) else if(include_diana_extensions)
entry.save(file, destination_type, false); entry.save(file, destination_type, false);
else else
...@@ -491,7 +491,7 @@ public class EntryFileDialog extends StickyFileChooser ...@@ -491,7 +491,7 @@ public class EntryFileDialog extends StickyFileChooser
ReadAndWriteEntry.writeDatabaseEntryToFile(entry, file, ReadAndWriteEntry.writeDatabaseEntryToFile(entry, file,
flattenGeneModel.isSelected(), flattenGeneModel.isSelected(),
ignoreObsoleteFeatures.isSelected(), true, ignoreObsoleteFeatures.isSelected(), true,
include_diana_extensions, destination_type, null); include_diana_extensions, false, destination_type, null);
else if(include_diana_extensions) else if(include_diana_extensions)
entry.save(file, destination_type, true); entry.save(file, destination_type, true);
else else
......
...@@ -136,6 +136,7 @@ public class ReadAndWriteEntry ...@@ -136,6 +136,7 @@ public class ReadAndWriteEntry
final boolean ignoreObsolete, final boolean ignoreObsolete,
final boolean force, final boolean force,
final boolean include_diana_extensions, final boolean include_diana_extensions,
final boolean removeProductForPseudo,
final int destination_type, final int destination_type,
final JFrame parent) final JFrame parent)
throws IOException, EntryInformationException throws IOException, EntryInformationException
...@@ -183,7 +184,27 @@ public class ReadAndWriteEntry ...@@ -183,7 +184,27 @@ public class ReadAndWriteEntry
if(include_diana_extensions) if(include_diana_extensions)
entry.save(file, destination_type, force, artemis_entry_information); entry.save(file, destination_type, force, artemis_entry_information);
else else
{
if(removeProductForPseudo)
{
uk.ac.sanger.artemis.io.FeatureVector features = entry.getEMBLEntry().getAllFeatures();
for(Feature f: features)
{
if(f.getKey().equals("polypeptide"))
{
Qualifier q = f.getQualifierByName("product");
if(q != null)
{
Feature gene = ((GFFStreamFeature) f).getChadoGene().getGene();
if(gene.getKey().equals("pseudogene"))
f.getQualifiers().remove(q);
}
}
}
}
entry.saveStandardOnly(file, destination_type, force); entry.saveStandardOnly(file, destination_type, force);
}
} }
...@@ -304,6 +325,7 @@ public class ReadAndWriteEntry ...@@ -304,6 +325,7 @@ public class ReadAndWriteEntry
System.out.println("-z\t[y|n] gzip output, default is y"); System.out.println("-z\t[y|n] gzip output, default is y");
System.out.println("-a\t[y|n] for EMBL submission format change to n, default is y"); System.out.println("-a\t[y|n] for EMBL submission format change to n, default is y");
System.out.println("-pp\t[y|n] read polypeptide domain features, default is n"); System.out.println("-pp\t[y|n] read polypeptide domain features, default is n");
System.out.println("-r\t[y|n] remove product qualifiers from pseudogene, default is n");
System.out.println("-c\tthe URL for your Chado database e.g. db.genedb.org:5432/snapshot?genedb_ro (if not using default)"); System.out.println("-c\tthe URL for your Chado database e.g. db.genedb.org:5432/snapshot?genedb_ro (if not using default)");
System.out.println("-u\t[swing|console|script] the UI mode : run in swing (with popup dialog boxes) mode, run in console mode (choices entered in the console window), or in script mode (all choices default to continue, all parameters passed on command line) "); System.out.println("-u\t[swing|console|script] the UI mode : run in swing (with popup dialog boxes) mode, run in console mode (choices entered in the console window), or in script mode (all choices default to continue, all parameters passed on command line) ");
System.out.println("-p\tthe password for connecting to the Chado database"); System.out.println("-p\tthe password for connecting to the Chado database");
...@@ -320,6 +342,7 @@ public class ReadAndWriteEntry ...@@ -320,6 +342,7 @@ public class ReadAndWriteEntry
String suffix = ".embl"; String suffix = ".embl";
boolean gzip = true; boolean gzip = true;
boolean noprivates = true; boolean noprivates = true;
boolean removeProductForPseudo = false;
String filePath = ""; String filePath = "";
...@@ -375,6 +398,11 @@ public class ReadAndWriteEntry ...@@ -375,6 +398,11 @@ public class ReadAndWriteEntry
{ {
System.setProperty("chado", args[i + 1]); System.setProperty("chado", args[i + 1]);
} }
else if (key.equals("-r"))
{
if(i + 1 < args.length && args[i + 1].toLowerCase().equals("y"))
removeProductForPseudo = true;
}
else if (key.equals("-p")) else if (key.equals("-p"))
{ {
System.setProperty("chadoPassword", args[i + 1]); System.setProperty("chadoPassword", args[i + 1]);
...@@ -443,7 +471,7 @@ public class ReadAndWriteEntry ...@@ -443,7 +471,7 @@ public class ReadAndWriteEntry
{ {
ReadAndWriteEntry.writeDatabaseEntryToFile( ReadAndWriteEntry.writeDatabaseEntryToFile(
entry, new File(filePath + names[i]+suffix), flatten, ignoreObsolete, entry, new File(filePath + names[i]+suffix), flatten, ignoreObsolete,
false, include_diana_extensions, false, include_diana_extensions, removeProductForPseudo,
format, null); format, null);
System.out.println("done"); System.out.println("done");
logger4j.info("done"); logger4j.info("done");
...@@ -457,7 +485,7 @@ public class ReadAndWriteEntry ...@@ -457,7 +485,7 @@ public class ReadAndWriteEntry
{ {
ReadAndWriteEntry.writeDatabaseEntryToFile(entry, new File(filePath + names[i] + suffix), ReadAndWriteEntry.writeDatabaseEntryToFile(entry, new File(filePath + names[i] + suffix),
flatten, ignoreObsolete, true, flatten, ignoreObsolete, true,
include_diana_extensions, format, null); include_diana_extensions, removeProductForPseudo, format, null);
System.out.println("done"); System.out.println("done");
logger4j.info("done"); logger4j.info("done");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment