Tabnine Logo
StudyEntry.setStats
Code IndexAdd Tabnine to your IDE (free)

How to use
setStats
method
in
org.opencb.biodata.models.variant.StudyEntry

Best Java code snippets using org.opencb.biodata.models.variant.StudyEntry.setStats (Showing top 18 results out of 315)

origin: org.opencb.biodata/biodata-models

@Deprecated
public void setCohortStats(String cohortName, VariantStats stats) {
  setStats(cohortName, stats);
}
origin: org.opencb.biodata/biodata-models

@Deprecated
public void setCohortStats(Map<String, VariantStats> cohortStats) {
  setStats(cohortStats);
}
origin: org.opencb.biodata/biodata-tools

/**
 * Looks for tags contained in statsTags and calculates stats parsing them.
 * @param variant
 * @param file
 * @param numAllele
 * @param reference
 * @param alternateAlleles
 * @param info
 */
protected void parseStats(Variant variant, StudyEntry file, int numAllele, String reference, String[] alternateAlleles, Map<String, String> info) {
  VariantStats vs = new VariantStats();
  Map<String, String> stats = new LinkedHashMap<>();
  for (Map.Entry<String, String> entry : info.entrySet()) {
    String infoTag = entry.getKey();
    String infoValue = entry.getValue();
    if (statsTags.contains(infoTag)) {
      stats.put(infoTag, infoValue);
    }
  }
  calculate(variant, file, numAllele, reference, alternateAlleles, stats, vs);
  file.setStats(StudyEntry.DEFAULT_COHORT, vs);
}
origin: org.opencb.biodata/biodata-tools

VariantStats vs = new VariantStats();
calculate(variant, file, numAllele, reference, alternateAlleles, cohortStats.get(cohortName), vs);
file.setStats(cohortName, vs);
origin: org.opencb.biodata/biodata-tools

/**
 * Calculates the statistics for some variants read from a set of files, and
 * optionally given pedigree information. Some statistics like inheritance
 * patterns can only be calculated if pedigree information is provided.
 *
 * @param variants The variants whose statistics will be calculated
 * @param ped Optional pedigree information to calculate some statistics
 */
public static void calculateStatsForVariantsList(List<Variant> variants, Pedigree ped) {
  for (Variant variant : variants) {
    for (StudyEntry entry : variant.getStudies()) {
      VariantStats stats = calculate(variant, entry);
      entry.setStats(StudyEntry.DEFAULT_COHORT, stats);
    }
  }
}
origin: org.opencb.biodata/biodata-tools

@Override
protected void parseStats(Variant variant, StudyEntry study, int numAllele, String reference, String[] alternateAlleles, Map<String, String> info) {
  FileEntry fileEntry = study.getFiles().get(0);
  // EVS params are not rearranged when normalizing. Use original call
  if (fileEntry.getCall() != null && !fileEntry.getCall().isEmpty()) {
    String[] ori = fileEntry.getCall().split(":");
    numAllele = Integer.parseInt(ori[3]);
    alternateAlleles = ori[2].split(",");
    reference = ori[1];
  }
  VariantStats stats = new VariantStats();
  if (info.containsKey("MAF")) {
    String splitsMAF[] = info.get("MAF").split(",");
    if (splitsMAF.length == 3) {
      float maf = Float.parseFloat(splitsMAF[2]) / 100;
      stats.setMaf(maf);
    }
  }
  if (info.containsKey("GTS") && info.containsKey("GTC")) {
    String splitsGTC[] = info.get("GTC").split(",");
    addGenotypeWithGTS(study.getAttributes(), splitsGTC, reference, alternateAlleles, numAllele, stats);
  }
  study.setStats(StudyEntry.DEFAULT_COHORT, stats);
}
origin: org.opencb.biodata/biodata-tools

studyEntry.setStats(StudyEntry.DEFAULT_COHORT, stats);
origin: opencb/opencga

BiMap<Integer, String> cohortIdMap = studyConfiguration.getCohortIds().inverse();
for (Map.Entry<Integer, VariantStats> entry : stats.getOrDefault(studyId, Collections.emptyMap()).entrySet()) {
  studyEntry.setStats(cohortIdMap.get(entry.getKey()), entry.getValue());
origin: opencb/opencga

study.setStats(new HashMap<>());
      study.setStats(cohort.getKey(), variantStats);
origin: opencb/opencga

BiMap<Integer, String> cohortIdMap = studyConfiguration.getCohortIds().inverse();
for (Map.Entry<Integer, VariantStats> entry : stats.getOrDefault(studyId, Collections.emptyMap()).entrySet()) {
  studyEntry.setStats(cohortIdMap.get(entry.getKey()), entry.getValue());
origin: opencb/opencga

studyEntry.setStats(Collections.emptyMap());
origin: org.opencb.biodata/biodata-tools

if (cohortStats == null) {
  cohortStats = new VariantStats();
  studyEntry.setStats(cohort, cohortStats);
    if (cohortStats == null) {
      cohortStats = new VariantStats();
      studyEntry.setStats(populations[i], cohortStats);
origin: org.opencb.biodata/biodata-tools

if (cohortStats == null) {
  cohortStats = new VariantStats();
  studyEntry.setStats(cohortName, cohortStats);
origin: opencb/opencga

sourceEntry = variant.getStudiesMap().get(sid);
if (sourceEntry != null) {
  sourceEntry.setStats(cid, variantStats);
} else {
origin: opencb/opencga

variantStats.setAltAlleleFreq(variantSearchModel.getStats().get(key));
variantStats.setMaf(Math.min(variantSearchModel.getStats().get(key), 1 - variantSearchModel.getStats().get(key)));
studyEntryMap.get(fields[1]).setStats(fields[2], variantStats);
origin: opencb/opencga

VariantStats stats = new VariantStats();
stats.addGenotype(new Genotype("0/0"), sc.getCohorts().get(cid).size());
st.setStats(sc.getCohortIds().inverse().get(cid), stats);
origin: opencb/opencga

expectedStudy.setStats(Collections.emptyMap());
Map<String, VariantStats> actualStudyStats = actualStudy.getStats();
actualStudy.setStats(Collections.emptyMap());
origin: opencb/opencga

loadedStudy.setStats(Collections.emptyMap());        //Remove calculated stats
loadedStudy.getSamplesData().forEach(values -> {
  values.set(0, values.get(0).replace("0/0", "0|0"));
org.opencb.biodata.models.variantStudyEntrysetStats

Popular methods of StudyEntry

  • getSamplesData
  • getFiles
  • <init>
  • getSampleData
  • getFile
  • getStudyId
  • getOrderedSamplesName
  • getSamplesName
  • setFiles
  • setFormat
  • setSamplesData
  • setSamplesPosition
  • setSamplesData,
  • setSamplesPosition,
  • getFormat,
  • getFormatPositions,
  • getStats,
  • addSampleData,
  • getSamplesPosition,
  • getSecondaryAlternates,
  • setSecondaryAlternates

Popular in Java

  • Reading from database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • setScale (BigDecimal)
  • getSupportFragmentManager (FragmentActivity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now