Skip to content
Snippets Groups Projects
Commit 997c2069 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

some debug for CI

parent f3ba0b64
No related branches found
No related tags found
2 merge requests!630WIP: Resolve "The privileges of a new user are not saved in some cases",!386Resolve "Continous integration tests"
Pipeline #6334 failed
......@@ -249,7 +249,6 @@ public class MiRNAParser extends CachableInterface implements IExternalService {
* thrown when there is a problem with accessing mirna data file
*/
private InputStream getSourceInputStream() throws IOException {
new Exception().printStackTrace();
if (this.sourceInputStream == null) {
this.sourceInputStream = new ByteArrayOutputStream();
......@@ -298,48 +297,50 @@ public class MiRNAParser extends CachableInterface implements IExternalService {
NPOIFSFileSystem fileInputStream = null;
try {
fileInputStream = new NPOIFSFileSystem(getSourceInputStream());
logger.debug("debug 1");
Workbook workbook = WorkbookFactory.create(fileInputStream);
logger.debug("debug 2");
Sheet sheet = workbook.getSheetAt(0);
logger.debug("debug 3");
Iterator<Row> rows = sheet.rowIterator();
// Skip header
if (rows.hasNext()) {
rows.next();
}
logger.debug("debug 4");
int counter = 0;
while (rows.hasNext()) {
logger.debug("next row"+ (counter++));
Row row = rows.next();
Cell targetSpeciesCell = row.getCell(SPECIES_COL, Row.RETURN_BLANK_AS_NULL);
MiriamData organism = null;
logger.debug("debug 1");
if (targetSpeciesCell != null) {
targetSpeciesCell.setCellType(Cell.CELL_TYPE_STRING);
String value = targetSpeciesCell.getStringCellValue();
organism = taxonomyBackend.getByName(value);
}
logger.debug("debug 2");
Cell mirBaseNamecell = row.getCell(MIR_BASE_NAME_COL, Row.RETURN_BLANK_AS_NULL);
if (mirBaseNamecell == null) {
continue;
}
logger.debug("debug 3");
mirBaseNamecell.setCellType(Cell.CELL_TYPE_STRING);
String name = mirBaseNamecell.getStringCellValue();
if (name == null || name.trim().isEmpty()) {
continue;
}
logger.debug("debug 4");
if (miRNAs.get(name) == null) {
miRNAs.put(name, new MiRNA(name));
}
logger.debug("debug 5");
MiriamData mirTaRBaseId = null;
Cell mirTaRBaseIdCell = row.getCell(MIR_TAR_BASE_ID_COL, Row.RETURN_BLANK_AS_NULL);
if (mirTaRBaseIdCell == null) {
continue;
} else {
logger.debug("debug 6");
mirTaRBaseIdCell.setCellType(Cell.CELL_TYPE_STRING);
String value = mirTaRBaseIdCell.getStringCellValue();
if (value == null || value.trim().isEmpty()) {
......@@ -347,17 +348,22 @@ public class MiRNAParser extends CachableInterface implements IExternalService {
} else {
mirTaRBaseId = new MiriamData(MiriamType.MIR_TAR_BASE_MATURE_SEQUENCE, value.trim());
}
logger.debug("debug 7");
}
Cell hgncCell = row.getCell(GENE_HGNC_ID_COL, Row.RETURN_BLANK_AS_NULL);
logger.debug("debug 8");
if (hgncCell != null) {
hgncCell.setCellType(Cell.CELL_TYPE_STRING);
String geneName = hgncCell.getStringCellValue();
logger.debug("debug 9");
if (geneName != null && !geneName.trim().isEmpty()) {
MiriamData gene = null;
if (TaxonomyBackend.HUMAN_TAXONOMY.equals(organism)) {
logger.debug("debug 10");
gene = new MiriamData(MiriamType.HGNC_SYMBOL, geneName.trim());
} else {
logger.debug("debug 11");
Cell entrezCell = row.getCell(GENE_ENTREZ_ID_COL, Row.RETURN_BLANK_AS_NULL);
if (entrezCell != null) {
entrezCell.setCellType(Cell.CELL_TYPE_STRING);
......@@ -365,9 +371,11 @@ public class MiRNAParser extends CachableInterface implements IExternalService {
// in case of non human target set the entrez
gene = new MiriamData(MiriamType.ENTREZ, entrezVal.trim());
}
logger.debug("debug 12");
}
MiRNA rna = miRNAs.get(name);
Target target = null;
logger.debug("debug 13");
for (Target t : rna.getTargets()) {
if (t.getGenes().contains(gene)) {
if (organism == null && t.getOrganism() == null) {
......@@ -377,6 +385,7 @@ public class MiRNAParser extends CachableInterface implements IExternalService {
}
}
}
logger.debug("debug 14");
if (target == null) {
target = new Target(mirTaRBaseId, gene, new ArrayList<>());
target.setType(TargetType.SINGLE_PROTEIN);
......@@ -384,6 +393,7 @@ public class MiRNAParser extends CachableInterface implements IExternalService {
target.setName(geneName);
rna.addTarget(target);
}
logger.debug("debug 15");
Cell pubmedCell = row.getCell(INTERACTION_PEDMED_ID_COL, Row.RETURN_BLANK_AS_NULL);
if (pubmedCell != null) {
pubmedCell.setCellType(Cell.CELL_TYPE_STRING);
......@@ -392,6 +402,7 @@ public class MiRNAParser extends CachableInterface implements IExternalService {
target.addReference(new MiriamData(MiriamType.PUBMED, value));
}
}
logger.debug("debug 16");
}
}
......
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