Package ru.autosome.commons.backgroundModel.mono

Examples of ru.autosome.commons.backgroundModel.mono.BackgroundModel


  }

  @Override
  protected List<DiPWM> load_collection_of_pwms() {
    if (fromMononucleotide) {
      BackgroundModel backgroundMononucleotide = Background.fromDiBackground(background);
      PWMImporter importer = new PWMImporter(backgroundMononucleotide, dataModel, effectiveCount, transpose);
      List<PWM> monoCollection = importer.loadMotifCollection(path_to_collection_of_pwms);
      List<DiPWM> diCollection = new ArrayList<DiPWM>(monoCollection.size());
      for(PWM monoPWM: monoCollection) {
        diCollection.add(DiPWM.fromPWM(monoPWM));
View Full Code Here


    List<Double> tokens = InputExtensions.listOfDoubleTokens(s);
    if (tokens.size() == 16) {
      return new DiBackground(ArrayExtensions.toPrimitiveArray(tokens));
    } else if (tokens.size() == 4) {
      BackgroundModel monoBackground = new Background(tokens);
      return DiBackground.fromMonoBackground( monoBackground );
    } else if (tokens.size() == 1) {
      return DiBackground.fromGCContent(tokens.get(0));
    } else {
      throw new IllegalArgumentException("Background string `" + s + "` not recognized.\n" +
View Full Code Here

    // But precalculation step should be done once
    Discretizer discretizer = new Discretizer(10000.0);
    // Wordwise background means that we calculate number of words instead of probabilities, this is a default mode
    // If one need to work with certain nucleotide background probabilities he should use:
    // BackgroundModel background = new Background(new double[]{pA, pC, pG, pT}); where {pA,... pT} are probabilities of respective nucleotides
    BackgroundModel background = new WordwiseBackground();
    // A actual pvalue will be less than requested. Not very important setting in this task
    BoundaryType pvalue_boundary = BoundaryType.LOWER;
    // Setting max_hash_size allows one to restrict memory exhausting during Pvalue calculation (using APE algorithm, not binary search)
    // Reasonable value is about 10 millions elements. But actually only specially constructed matrices can reach such high hash sizes.
    // So in standalone calculation we use null (not to check hash size) and in web version we use 1e7
View Full Code Here

  }

  @Override
  protected DiPWM loadQueryMotif() {
    if (queryFromMononucleotide) {
      BackgroundModel queryBackgroundMononucleotide = Background.fromDiBackground(queryBackground);
      PWMImporter importer = new PWMImporter(queryBackgroundMononucleotide, dataModel, effectiveCount, queryTranspose);
      return DiPWM.fromPWM(importer.loadMotif(queryPMFilename));
    } else {
      DiPWMImporter importer = new DiPWMImporter(queryBackground, dataModel, effectiveCount, queryTranspose);
      return importer.loadMotif(queryPMFilename);
View Full Code Here

  boolean fromMononucleotide;

  @Override
  protected List<DiPWM> loadMotifCollection(File path_to_collection) {
    if (fromMononucleotide) {
      BackgroundModel backgroundMononucleotide = Background.fromDiBackground(background);
      PWMImporter importer = new PWMImporter(backgroundMononucleotide, dataModel, effectiveCount, transpose);
      List<PWM> monoCollection = importer.loadMotifCollection(path_to_collection);
      pwmCollection = new ArrayList<DiPWM>(monoCollection.size());
      for(PWM monoPWM: monoCollection) {
        pwmCollection.add(DiPWM.fromPWM(monoPWM));
View Full Code Here

  }

  @Override
  protected DiPWM loadFirstPWM(String filename) {
    if (firstPWMFromMononucleotide) {
      BackgroundModel firstBackgroundMononucleotide = Background.fromDiBackground(firstBackground);
      PWMImporter firstMotifImporter = new PWMImporter(firstBackgroundMononucleotide, dataModelFirst, effectiveCountFirst, transposeFirst);
      return DiPWM.fromPWM( firstMotifImporter.loadMotif(filename) );
    } else {
      DiPWMImporter firstMotifImporter = new DiPWMImporter(firstBackground, dataModelFirst, effectiveCountFirst, transposeFirst);
      return firstMotifImporter.loadMotif(filename);
View Full Code Here

    }
  }
  @Override
  protected DiPWM loadSecondPWM(String filename) {
    if (secondPWMFromMononucleotide) {
      BackgroundModel secondBackgroundMononucleotide = Background.fromDiBackground(secondBackground);
      PWMImporter secondMotifImporter = new PWMImporter(secondBackgroundMononucleotide, dataModelSecond, effectiveCountSecond, transposeSecond);
      return DiPWM.fromPWM( secondMotifImporter.loadMotif(filename) );
    } else {
      DiPWMImporter secondMotifImporter = new DiPWMImporter(secondBackground, dataModelSecond, effectiveCountSecond, transposeSecond);
      return secondMotifImporter.loadMotif(filename);
View Full Code Here

      Discretizer discretizer = new Discretizer(100.0);

//      CountingPWM firstPWMCounting = new CountingPWM(firstPWM.discrete(discretizer), new WordwiseBackground(), null);
//      CountingPWM secondPWMCounting = new CountingPWM(secondPWM.discrete(discretizer), new WordwiseBackground(), null);

      BackgroundModel background = new WordwiseBackground();
//      BackgroundModel background = new Background(new double[]{0.25,0.25,0.25,0.25});

      CompareModels comparator = new CompareModels(firstPWM, secondPWM, background, background, discretizer, null, null);
      CompareModelsCountsGiven.SimilarityInfo similarityInfo = comparator.jaccard_by_weak_pvalue(0.0005);
      System.out.println("\n----------\n" + similarityInfo.similarity());
View Full Code Here

  }

  @Override
  protected List<DiPWM> loadMotifCollection() {
    if (collectionFromMononucleotide) {
      BackgroundModel collectionBackgroundMononucleotide = Background.fromDiBackground(collectionBackground);
      PWMImporter importer = new PWMImporter(collectionBackgroundMononucleotide, dataModel, effectiveCount, collectionTranspose);
      List<PWM> monoCollection = importer.loadMotifCollection(pathToCollectionOfPWMs);
      List<DiPWM> diCollection = new ArrayList<DiPWM>(monoCollection.size());
      for(PWM monoPWM: monoCollection) {
        diCollection.add(DiPWM.fromPWM(monoPWM));
View Full Code Here

  }

  @Override
  protected DiPWM loadMotif(String filename) {
    if (fromMononucleotide) {
      BackgroundModel backgroundMononucleotide = Background.fromDiBackground(background);
      PWMImporter importer = new PWMImporter(backgroundMononucleotide, data_model, effective_count, transpose);
      return DiPWM.fromPWM( importer.loadMotif(filename) );
    } else {
      DiPWMImporter importer = new DiPWMImporter(background, data_model, effective_count, transpose);
      return importer.loadMotif(filename);
View Full Code Here

TOP

Related Classes of ru.autosome.commons.backgroundModel.mono.BackgroundModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.