Commit 42e2e933 authored by Michael Menzel's avatar Michael Menzel

vm version

parent 1285d412
......@@ -10,13 +10,17 @@ Enhort is build to run on two different servers, a computation back-end server a
# Database
### Use pre-build database
Download the SQlite database and the corresponding .bed tracks from .... Save the database and the data files in a known directory.
Download the minimal SQlite database and the corresponding .bed-tracks from
https://homepages.thm.de/~mmnz21/minimal.db
https://homepages.thm.de/~mmnz21/enhort_bed_files_hg19.tar.gz %add hg19 folder
### Build own database
Save the database and unpack .bed-files in a known directory.
### Build your own database
TODO
# Server setup
Download the enhort.jar from ....
Download the enhort.jar from https://homepages.thm.de/~mmnz21/enhort.jar
Create a empty directory /logs in user home directory for logfiles
......@@ -33,7 +37,8 @@ The server is run with the following command:
# Frontend setup
Download the frontend archive containing the .jar and the contig sizes for hg19 and hg38.
Download the frontend archive containing the .jar and the contig sizes for hg19 and hg38 from
https://homepages.thm.de/~mmnz21/frontend.tar.gz
Create a empty directory /logs in user home directory for logfiles
The frontend is run with the following command:
......@@ -53,6 +58,17 @@ The frontend is run with the following command:
TODO
### Package Frontend.tar.gz
tar cvf frontend.tar frontend.jar ../../con/
#### Content:
- 5 frontend.jar
- 6 con/
- 7 con/contigs_GRCh38
- 8 con/contigs_hg19
- 9 con/contigs_hg18
### Known issues
- The sample button does not work on custom systems because the .bed-file used for the sample run is not available
This diff is collapsed.
......@@ -98,6 +98,7 @@ class FileLoader implements Callable<Optional<Track>> {
List<String> names = new ArrayList<>(linecount);
List<Double> scores = new ArrayList<>(linecount);
List<Character> strands = new ArrayList<>(linecount);
int counter = 0;
try (Stream<String> lines = Files.lines(file.toPath(), StandardCharsets.UTF_8)) {
Iterator<String> it = lines.iterator();
......@@ -124,6 +125,7 @@ class FileLoader implements Callable<Optional<Track>> {
if (line_matcher.matches()) {
String[] parts = line.split("\t");
counter++;
long start;
long end;
......@@ -186,10 +188,16 @@ class FileLoader implements Callable<Optional<Track>> {
else strands.add('o');
}
}
}
lines.close();
if (linecount != counter)
logger.error("File " + file.getName() + " has " + counter + " lines, but db says it has " + linecount + " lines.");
// Check read files //
if (logger.isDebugEnabled()) {
......
......@@ -23,6 +23,9 @@ import de.thm.misc.Genome;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.*;
import java.util.concurrent.*;
import java.util.stream.Collectors;
......@@ -108,12 +111,14 @@ public final class TrackFactory {
if (System.getenv("HOME").contains("menzel")) {
allTracks = connector.getAllTracks("WHERE name like '%ontigs'");
/*
allTracks = connector.getAllTracks(" WHERE directory like '%genetic%' and genome_assembly = 'hg19' ORDER BY lines ASC ");
allTracks.addAll(connector.getAllTracks("WHERE genome_assembly = 'hg19' and directory like '%encode%HeLa%'"));
allTracks.addAll(connector.getAllTracks("WHERE genome_assembly = 'hg19' and directory like '%custom%'"));
//allTracks = connector.getAllTracks("WHERE bed_filename = 'SRX062365.05.bed'");
allTracks.addAll(connector.getAllTracks("WHERE name like '%ontigs'"));
//allTracks = connector.getAllTracks(" WHERE genome_assembly = 'hg19' ORDER BY lines ASC LIMIT 3000");
*/
} else {
allTracks = connector.getAllTracks("WHERE (cell_line NOT like '%GM%' or cell_line like '%GM12878')");
......@@ -132,6 +137,27 @@ public final class TrackFactory {
logger.info("Trying to load " + allTracks.size() + " tracks");
this.tracks.addAll(loadByEntries(allTracks));
List<TrackEntry> customTracks = new ArrayList<>();
// Add custom tracks
if (System.getenv("HOME").contains("menzel")) {
try {
Files.walk(Paths.get("/home/menzel/Desktop/THM/promotion/enhort/dat/stefan/custom"))
.filter(Files::isRegularFile)
.filter(f -> f.getFileName().toString().endsWith(".bed"))
.forEach(f -> customTracks.add(new TrackEntry(f.getFileName().toString(),"Custom track: " + f.getFileName(),
"/home/menzel/Desktop/THM/promotion/enhort/dat/stefan/custom/" + f.getFileName().toString(), "inout", Genome.Assembly.GRCh38.toString(), "Unknown", 14003120, "Genetic", 1412123+f.getFileName().hashCode(), "nosource", "nourl")));
} catch (IOException e) {
e.printStackTrace();
}
}
logger.info("Trying to load " + customTracks.size() + " custom tracks");
customTracks.forEach(e -> trackEntries.put(e.getName(), e));
this.tracks.addAll(loadByEntries(customTracks));
//TODO use DB:
List<String> trackPackagesNames = new ArrayList<>();
......@@ -153,7 +179,7 @@ public final class TrackFactory {
}
}
allTracks.forEach(e -> trackEntries.put(e.getName(), e));
}
/**
......@@ -187,7 +213,7 @@ public final class TrackFactory {
exe.shutdown();
try {
int timeout = (System.getenv("HOME").contains("menzel")) ? 30 : 60 * 2;
int timeout = (System.getenv("HOME").contains("menzel")) ? 60 : 60 * 2;
completionService.poll(timeout, TimeUnit.SECONDS);
logger.warn("Still loading track files. Stopping now");
......
......@@ -207,8 +207,10 @@ class AnalysisHelper {
List<Sites> batchSites = command.getBatchSites();
Sites bg;
int bgsitecount = Math.max(command.getMinBg(),batchSites.stream().map(s -> s.getPositions().size()).max(Integer::compareTo).get());
if (command.getSitesBg() == null)
bg = BackgroundModelFactory.createBackgroundModel(command.getAssembly(), command.getMinBg());
bg = BackgroundModelFactory.createBackgroundModel(command.getAssembly(),bgsitecount);
else
bg = command.getSitesBg();
......
This diff is collapsed.
......@@ -47,12 +47,7 @@ public final class ChromosomSizes {
*/
private ChromosomSizes() {
//TODO use db again?
if(System.getenv("HOME").contains("menzel")) {
chromosomeSizes = getChrSizesFromFile("/home/menzel/Desktop/THM/lfba/enhort/repo/backend/chrSizes.csv");
} else {
chromosomeSizes = getChrSizesFromFile("/home/mmnz21/enhort/chrSizes.csv");
}
chromosomeSizes = getChrSizes();
for(Genome.Assembly assembly: chromosomeSizes.keySet()) {
Map<String, Integer> hg = chromosomeSizes.get(assembly);
......@@ -69,6 +64,68 @@ public final class ChromosomSizes {
calcOffsets();
}
private Map<Genome.Assembly, Map<String, Integer>> getChrSizes() {
String input = "hg19,chr1,249250621\n" +
"hg19,chr2,243199373\n" +
"hg19,chr3,198022430\n" +
"hg19,chr4,191154276\n" +
"hg19,chr5,180915260\n" +
"hg19,chr6,171115067\n" +
"hg19,chr7,159138663\n" +
"hg19,chr8,146364022\n" +
"hg19,chr9,141213431\n" +
"hg19,chr10,135534747\n" +
"hg19,chr11,135006516\n" +
"hg19,chr12,133851895\n" +
"hg19,chr13,115169878\n" +
"hg19,chr14,107349540\n" +
"hg19,chr15,102531392\n" +
"hg19,chr16,90354753\n" +
"hg19,chr17,81195210\n" +
"hg19,chr18,78077248\n" +
"hg19,chr19,59128983\n" +
"hg19,chr20,63025520\n" +
"hg19,chr21,48129895\n" +
"hg19,chr22,51304566\n" +
"hg19,chrX,155270560\n" +
"hg19,chrY,59373566\n" +
"GRCh38,chr1,248956422\n" +
"GRCh38,chr2,242193529\n" +
"GRCh38,chr3,198295559\n" +
"GRCh38,chr4,190214555\n" +
"GRCh38,chr5,181538259\n" +
"GRCh38,chr6,170805979\n" +
"GRCh38,chr7,159345973\n" +
"GRCh38,chr8,145138636\n" +
"GRCh38,chr9,138394717\n" +
"GRCh38,chr10,133797422\n" +
"GRCh38,chr11,135086622\n" +
"GRCh38,chr12,133275309\n" +
"GRCh38,chr13,114364328\n" +
"GRCh38,chr14,107043718\n" +
"GRCh38,chr15,101991189\n" +
"GRCh38,chr16,90338345\n" +
"GRCh38,chr17,83257441\n" +
"GRCh38,chr18,80373285\n" +
"GRCh38,chr19,58617616\n" +
"GRCh38,chr20,64444167\n" +
"GRCh38,chr21,46709983\n" +
"GRCh38,chr22,50818468\n" +
"GRCh38,chrX,156040895\n" +
"GRCh38,chrY,57227415";
Map<Genome.Assembly, Map<String, Integer>> chrs = new HashMap<>();
for( String line: input.split("\n")) {
String[] parts = line.split(",");
if (!chrs.containsKey(Genome.Assembly.valueOf(parts[0])))
chrs.put(Genome.Assembly.valueOf(parts[0]), new HashMap<>());
chrs.get(Genome.Assembly.valueOf(parts[0])).put(parts[1], Integer.parseInt(parts[2]));
}
return chrs;
}
private Map<Genome.Assembly,Map<String,Integer>> getChrSizesFromFile(String filepath) {
Map<Genome.Assembly, Map<String, Integer>> chrs = new HashMap<>();
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment