Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changed IS_GERMLINE to SV_STATUS #11

Open
wants to merge 16 commits into
base: add-germline-flag-to-sv
Choose a base branch
from
Open
119 changes: 0 additions & 119 deletions core/src/main/java/org/mskcc/cbio/maf/FusionFileUtil.java

This file was deleted.

152 changes: 0 additions & 152 deletions core/src/main/java/org/mskcc/cbio/maf/FusionRecord.java

This file was deleted.

10 changes: 9 additions & 1 deletion core/src/main/java/org/mskcc/cbio/maf/TabDelimitedFileUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,19 @@ public static Long getPartLong(int index, String[] parts) {
}
}

// This method does not call Integer.parseInt() as one might expect.
// Presumably this is to allow the convertion of strings like "6.2" to "6".
// The method previously called (int)Float.parseFloat() but floats
// reserve 23 bits for the mantissa and ints are 32 bits so precision
// was lost parsing "138536968" which was converted to 138536960.
// Now we call (int)Double.parseDouble() because double allocates
// 52 bits for the mantissa. Note getPartLong calls Long.parseLong()
// when this does not call Integer.parseInt() which seems inconsistent.
public static Integer getPartInt(int index, String[] parts)
{
try {
String part = parts[index];
return (int)(Float.parseFloat(part));
return (int)(Double.parseDouble(part));
} catch (ArrayIndexOutOfBoundsException e) {
return NA_INT;
} catch (NumberFormatException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,7 @@ public static void createMutationCountClinicalData(GeneticProfile geneticProfile
* We do not add the MUTATION_COUNT clinical data for the sample if
* it's not profiled. If it *is* profiled but there are 0
* mutations, add a MUTATION_COUNT with 0 value record. Do not
* include germline and fusions (msk internal) when counting
* mutations.
* include germline when counting mutations.
*
* Use REPLACE (conditional INSERT/UPDATE) which inserts
* new counts if they don't exist and overwrites them if they do.
Expand All @@ -207,7 +206,6 @@ public static void createMutationCountClinicalData(GeneticProfile geneticProfile
"LEFT JOIN mutation ON mutation.`SAMPLE_ID` = sample_profile.`SAMPLE_ID` " +
"AND ( mutation.`MUTATION_STATUS` <> 'GERMLINE' OR mutation.`MUTATION_STATUS` IS NULL ) " +
"LEFT JOIN mutation_event ON mutation.`MUTATION_EVENT_ID` = mutation_event.`MUTATION_EVENT_ID` " +
"AND ( mutation_event.`MUTATION_TYPE` <> 'Fusion' OR mutation_event.`MUTATION_TYPE` IS NULL ) " +
"INNER JOIN genetic_profile ON genetic_profile.`GENETIC_PROFILE_ID` = sample_profile.`GENETIC_PROFILE_ID` " +
"WHERE genetic_profile.`GENETIC_ALTERATION_TYPE` = 'MUTATION_EXTENDED' " +
"AND genetic_profile.`GENETIC_PROFILE_ID`=? " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ public static void addStructuralVariantToBulkLoader(StructuralVariant structural
"CLASS",
"LENGTH",
"COMMENTS",
"EXTERNAL_ANNOTATION"
"EXTERNAL_ANNOTATION",
"SV_STATUS",
};
bl.setFieldNames(fieldNames);

Expand All @@ -89,13 +90,13 @@ public static void addStructuralVariantToBulkLoader(StructuralVariant structural
Long.toString(structuralVariant.getInternalId()),
Integer.toString(structuralVariant.getGeneticProfileId()),
Integer.toString(structuralVariant.getSampleIdInternal()),
Long.toString(structuralVariant.getSite1EntrezGeneId()),
structuralVariant.getSite1EntrezGeneId() == null ? null : Long.toString(structuralVariant.getSite1EntrezGeneId()),
structuralVariant.getSite1EnsemblTranscriptId(),
Integer.toString(structuralVariant.getSite1Exon()),
structuralVariant.getSite1Chromosome(),
Integer.toString(structuralVariant.getSite1Position()),
structuralVariant.getSite1Description(),
Long.toString(structuralVariant.getSite2EntrezGeneId()),
structuralVariant.getSite2EntrezGeneId() == null ? null : Long.toString(structuralVariant.getSite2EntrezGeneId()),
structuralVariant.getSite2EnsemblTranscriptId(),
Integer.toString(structuralVariant.getSite2Exon()),
structuralVariant.getSite2Chromosome(),
Expand All @@ -121,7 +122,8 @@ public static void addStructuralVariantToBulkLoader(StructuralVariant structural
structuralVariant.getVariantClass(),
Integer.toString(structuralVariant.getLength()),
structuralVariant.getComments(),
structuralVariant.getExternalAnnotation());
structuralVariant.getExternalAnnotation(),
structuralVariant.getSvStatus());

if ((structuralVariant.getDriverFilter() != null
&& !structuralVariant.getDriverFilter().isEmpty()
Expand Down Expand Up @@ -237,6 +239,7 @@ private static StructuralVariant extractStructuralVariant(ResultSet rs) throws S
structuralVariant.setDriverFilterAnn(rs.getString("DRIVER_FILTER_ANNOTATION"));
structuralVariant.setDriverTiersFilter(rs.getString("DRIVER_TIERS_FILTER"));
structuralVariant.setDriverTiersFilterAnn(rs.getString("DRIVER_TIERS_FILTER_ANNOTATION"));
structuralVariant.setSvStatus(rs.getString("SV_STATUS"));
return structuralVariant;
}
}
Expand Down
19 changes: 1 addition & 18 deletions core/src/main/java/org/mskcc/cbio/portal/model/CancerStudy.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015 - 2016 Memorial Sloan-Kettering Cancer Center.
* Copyright (c) 2015 - 2022 Memorial Sloan-Kettering Cancer Center.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS
Expand Down Expand Up @@ -445,23 +445,6 @@ public boolean hasSurvivalData() throws DaoException {
attrs.contains(ClinicalAttribute.DFS_STATUS);
}

/**
* Check if study has fusion data
* @return true if has fusion data, false when it's not
*/
public boolean hasFusionData() {
ArrayList<GeneticProfile> geneticProfiles = DaoGeneticProfile.getAllGeneticProfiles(studyID);
boolean hasFusionData = false;
for (GeneticProfile geneticProfile : geneticProfiles) {
if (geneticProfile.getDatatype().equals("SV")) { // check if genetic profiles contains Structural Variant
// data type
hasFusionData = true;
break;
}
}
return hasFusionData;
}

public String getTypeOfCancer() throws DaoException {
return DaoTypeOfCancer.getTypeOfCancerById(this.typeOfCancerId).getName();
}
Expand Down
Loading