Skip to content
Snippets Groups Projects
Commit ee3e959b authored by kohleman's avatar kohleman
Browse files

added bowtie.txt which contains the bowtie indices

SVN: 18089
parent f4e7a2da
No related branches found
No related tags found
No related merge requests found
package ch.ethz.bsse.cisd.dsu.properties;
import java.util.HashMap;
/*
......@@ -18,41 +19,54 @@ import java.util.HashMap;
*/
/**
*
*
* @author Manuel Kohler
*/
public class GenomeMap
{
private static String PATH_TO_GENOMES = "/array0/Genomes/";
private static HashMap <String, String> genomePaths = new HashMap<String, String>();
static {
genomePaths.put("PHIX", PATH_TO_GENOMES + "PhiX");
genomePaths.put("MUS_MUSCULUS",PATH_TO_GENOMES + "MusMus/Ncbi37_Ensembl49");
genomePaths.put("HOMO_SAPIENS",PATH_TO_GENOMES + "HomSap/Release36.50");
genomePaths.put("DROSOPHILA_MELANOGASTER",PATH_TO_GENOMES + "DrosMel/Release5");
genomePaths.put("CAENORHABDITIS_ELEGANS",PATH_TO_GENOMES + "Celegans/Release112708");
genomePaths.put("ESCHERICHIA_COLI",PATH_TO_GENOMES + "EColi");
genomePaths.put("RATTUS_NORVEGICUS",PATH_TO_GENOMES + "");
private static String PATH_TO_GENOMES = "/array0/Genomes/";
private static HashMap<String, String> genomePaths = new HashMap<String, String>();
static
{
genomePaths.put("PHIX", PATH_TO_GENOMES + "PhiX");
genomePaths.put("MUS_MUSCULUS", PATH_TO_GENOMES + "MusMus/Ncbi37_Ensembl49");
genomePaths.put("HOMO_SAPIENS", PATH_TO_GENOMES + "HomSap/Release36.50");
genomePaths.put("DROSOPHILA_MELANOGASTER", PATH_TO_GENOMES + "DrosMel/Release5");
genomePaths.put("CAENORHABDITIS_ELEGANS", PATH_TO_GENOMES + "Celegans/Release112708");
genomePaths.put("ESCHERICHIA_COLI", PATH_TO_GENOMES + "EColi");
genomePaths.put("RATTUS_NORVEGICUS", PATH_TO_GENOMES + "");
}
public static String getGenomePath(String genome) {
public static String getGenomePath(String genome)
{
return genomePaths.get(genome);
}
private static HashMap <String, String> endType = new HashMap<String, String>();
static {
private static HashMap<String, String> endType = new HashMap<String, String>();
static
{
endType.put("SINGLE_READ", "eland_extended");
endType.put("PAIRED_END", "eland_pair");
}
public static String getEndType(String openbisEndType) {
return endType.get(openbisEndType);
}
}
public static String getEndType(String openbisEndType)
{
return endType.get(openbisEndType);
}
private static HashMap<String, String> bowtieIndex = new HashMap<String, String>();
static
{
bowtieIndex.put("PHIX", "phiX");
bowtieIndex.put("MUS_MUSCULUS", "ncbi37_mm9");
bowtieIndex.put("HOMO_SAPIENS", "h_sapiens_37_asm");
bowtieIndex.put("DROSOPHILA_MELANOGASTER", "d_melanogaster_fb5_22");
}
public static String getBowtieIndex(String genome)
{
return bowtieIndex.get(genome);
}
}
......@@ -48,6 +48,8 @@ public class GetSampleProperties
private static final String END_TYPE = "END_TYPE";
private static final String ELAND_CONFIG_FILE = "config.txt";
private static final String BOWTIE_CONFIG_FILE = "bowtie.txt";
private static final String DEFAULT_FLOW_CELL_SPACE = "CISD:/BSSE_FLOWCELLS/";
// private static final String DEFAULT_FLOW_CELL_SPACE = "default_flow_cell_space";
......@@ -64,6 +66,7 @@ public class GetSampleProperties
public static void main(String[] args) throws IOException
{
FileWriter writer = new FileWriter(ELAND_CONFIG_FILE);
FileWriter bowtieWriter = new FileWriter(BOWTIE_CONFIG_FILE);
Properties prop = PropertyUtils.loadProperties(SERVICE_PROPERTIES);
Long techId = 0L;
String endType = "";
......@@ -128,7 +131,9 @@ public class GetSampleProperties
for (Entry<Integer, List<Sample>> entry : parentSamples.entrySet())
{
Integer key = entry.getKey();
String gP = "";
String propertyString = "";
String pathToGenome = "";
String bowtieIndexName = "";
List<Sample> samples = entry.getValue();
// get the properties of the first parent
List<IEntityProperty> properties = samples.get(0).getProperties();
......@@ -138,11 +143,14 @@ public class GetSampleProperties
{
try
{
gP = GenomeMap.getGenomePath(property.tryGetAsString());
if (gP != null)
propertyString = property.tryGetAsString();
pathToGenome = GenomeMap.getGenomePath(propertyString);
bowtieIndexName = GenomeMap.getBowtieIndex(propertyString);
if (pathToGenome != null)
{
writer.write(key + ":ELAND_GENOME " + gP + "\n");
writer.write(key + ":ELAND_GENOME " + pathToGenome + "\n");
writer.write(key + ":ANALYSIS " + endType + "\n");
bowtieWriter.write(bowtieIndexName + "\n");
}
} catch (IOException ex)
......@@ -154,7 +162,9 @@ public class GetSampleProperties
}
writer.write("ELAND_SET_SIZE 10\n" + "EMAIL_LIST manuel.kohler@bsse.ethz.ch");
writer.close();
bowtieWriter.close();
operationLog.info("Writing " + ELAND_CONFIG_FILE);
operationLog.info("Writing " + BOWTIE_CONFIG_FILE);
service.logout(sessionToken);
}
......
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