Package ru.autosome.commons.importer

Examples of ru.autosome.commons.importer.PWMImporter


    background = new WordwiseBackground();
  }

  @Override
  protected List<PWM> load_collection_of_pwms() {
    PWMImporter importer = new PWMImporter(background, dataModel, effectiveCount, transpose);
    return importer.loadMotifCollection(path_to_collection_of_pwms);
  }
View Full Code Here


  @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));
      }
      return diCollection;
    } else {
      DiPWMImporter importer = new DiPWMImporter(background, dataModel, effectiveCount, transpose);
      return importer.loadMotifCollection(path_to_collection_of_pwms);
    }
  }
View Full Code Here

    // Collection of PWMs to test on sequences
    List<PWM> pwmCollection = new ArrayList<PWM>();

    // One way is to load PWMs from files
    pwmCollection.add(new PWMImporter().loadMotif("test_data/pwm/KLF4_f2.pwm"));
    pwmCollection.add(new PWMImporter().loadMotif("test_data/pwm/SP1_f1.pwm"));

    // Another way is to create PWM by specifying (Nx4)-matrix and PWM name
    double[][] matrix_cAVNCT = { {1.0, 2.0, 1.0, 1.0},
                                {10.5, -3.0, 0.0, 0.0},
                                {5.0, 5.0, 5.0, -10.0},
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));
      }
      return diCollection;
    } else {
      DiPWMImporter importer = new DiPWMImporter(collectionBackground, dataModel, effectiveCount, collectionTranspose);
      return importer.loadMotifCollection(pathToCollectionOfPWMs);
    }
  }
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

  @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));
      }
      return pwmCollection;
    } else {
      DiPWMImporter importer = new DiPWMImporter(background, dataModel, effectiveCount, transpose);
      return importer.loadMotifCollection(path_to_collection);
    }
  }
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

    Collections.addAll(argv, args);
    return from_arglist(argv);
  }

  protected List<PWM> loadMotifCollection() {
    PWMImporter importer = new PWMImporter(collectionBackground, dataModel, effectiveCount, collectionTranspose);
    return importer.loadMotifCollection(pathToCollectionOfPWMs);
  }
View Full Code Here

    PWMImporter importer = new PWMImporter(collectionBackground, dataModel, effectiveCount, collectionTranspose);
    return importer.loadMotifCollection(pathToCollectionOfPWMs);
  }

  protected PWM loadQueryMotif() {
    PWMImporter importer = new PWMImporter(queryBackground, dataModel, effectiveCount, queryTranspose);
    return importer.loadMotif(queryPMFilename);
  }
View Full Code Here

TOP

Related Classes of ru.autosome.commons.importer.PWMImporter

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.