Package gem.parser

Examples of gem.parser.TabDelimitedFileParser


   * Leaves one row per gene symbol. Selects rows with max mean expression.
   * @param dir
   */
  private static void filterExpressionData(String dir) throws IOException
  {
    TabDelimitedFileParser parser = new TabDelimitedFileParser(dir + "/platform.txt");
    Map<String, String> id2sym = parser.getOneToOneMap("ID", "Gene Symbol");

    Map<String, String> sym2row = new HashMap<String, String>();
    Map<String, Double> sym2mean = new HashMap<String, Double>();
    Map<String, Integer> sym2cnt = new HashMap<String, Integer>();

View Full Code Here


  private static Map<String, List<double[]>> getValuesOf(String[] sym) throws IOException
  {
    Map<String, List<double[]>> map = new HashMap<String, List<double[]>>();

    String dir = "resource/expdata/expo/";
    TabDelimitedFileParser parser = new TabDelimitedFileParser(dir + "platform.txt");
    Map<String, Set<String>> sym2id = parser.getOneToManyMap("Gene Symbol", "ID");

    Map<String, String> id2sym = new HashMap<String, String>();

    for (String s : sym)
    {
View Full Code Here

   
    Set<String>[] set = new Set[size];
   
    for (int i = 0; i < size; i++)
    {
      TabDelimitedFileParser p = new TabDelimitedFileParser(file);
      set[i] = p.getColumnSet(i);
    }

    for (String s : getCommon(set[0], set[1]))
    {
      System.out.println(s);
View Full Code Here

  }

  private static void printAndrResponsiveTarChange() throws Throwable
  {
//    TabDelimitedFileParser parser = new TabDelimitedFileParser("resource/expdata/AR-GR/GR-in-lung.txt");
    TabDelimitedFileParser parser = new TabDelimitedFileParser("resource/factors/AR_andr_small.txt");
//    Map<String,String> scores = parser.getOneToOneMap("Target", "Correlation");
    Map<String,String> scores = parser.getOneToOneMap("Target", "Score");

    Set<String> ids = new HashSet<String>();
    for (String sym : scores.keySet()) ids.add(Triplet.getSymbolToGeneMap().get(sym));

    String dir = "resource/expdata/GSE11428/";
//    Map<String, Gene> geneMap = ExpDataReader.readMouseHomologs(ids, dir, 0, 0);
    Map<String, Gene> geneMap = ExpDataReader.readGenes(ids, dir, 0, 0);
//    Map<String, Gene> geneMap = CrossPlatformMapper.fetchGenes(scores.keySet(), dir + "data.txt");

    parser = new TabDelimitedFileParser("resource/factors/AR-select-small.txt");
    Set<String> select = parser.getColumnSet(0);

    boolean[][] pos = StageAnalyzer.getPos(dir);
    String[] stage = StageAnalyzer.getStageNames(dir);
//    boolean[] pos1 = pos[1];
//    boolean[] pos2 = pos[2];
View Full Code Here

  public static void printGeneChangeInExp() throws Throwable
  {
//    Set<String> modNames = HPRDParser.readFor(Collections.singleton("AR")).get("AR");

//    TabDelimitedFileParser p = new TabDelimitedFileParser("resource/factors/AR-select-small.txt");
    TabDelimitedFileParser p = new TabDelimitedFileParser("resource/NuclearReceptors.txt");
//    TabDelimitedFileParser p = new TabDelimitedFileParser("resource/JUN_targets.txt");
    Set<String> modNames = p.getColumnSet(0);
//    modNames.add("UBE2C");

//    Set<String> modNames = new HashSet<String>(HGNCParser.getGeneToSymbolMap().values());

    Set<String> ids = new HashSet<String>();
View Full Code Here

  public static void printGeneChangeDistr() throws Throwable
  {
//    Map<String, Set<String>> map = HPRDParser.readFor(new HashSet<String>(Arrays.asList("AR")));
//    Set<String> modNames = new HashSet<String>(map.get("AR"));

    TabDelimitedFileParser p = new TabDelimitedFileParser("resource/NuclearReceptors.txt");
    Set<String> modNames = p.getColumnSet(0);

    Set<String> ids = new HashSet<String>();
    for (String name : modNames)
    {
      ids.add(Triplet.getSymbolToGeneMap().get(name));
View Full Code Here

  public static void findCorrelationInTissue() throws Throwable
  {
//    TabDelimitedFileParser p = new TabDelimitedFileParser("resource/factors/AR-select-small.txt");
//    TabDelimitedFileParser p = new TabDelimitedFileParser("resource/factors/AR_andr_small.txt");
    TabDelimitedFileParser p = new TabDelimitedFileParser("temp2");
    Set<String> syms = p.getColumnSet(0);
    String grSym = "ESR1";
    String arSym = "AR";
    syms.add(grSym);
    syms.add(arSym);

    p = new TabDelimitedFileParser("resource/factors/AR_andr_small.txt");
    Map<String, String> score = p.getOneToOneMap("Target", "Score");

//    p = new TabDelimitedFileParser("resource/factors/AR-conflict.txt");
//    Set<String> conf = p.getColumnSet(0);

    Set<String> ids = new HashSet<String>();
View Full Code Here

    SetUtils.printVenn(s1, s2);
  }

  public static void showChangesInAbsenceAndPresenceOfAndrogen() throws Throwable
  {
    TabDelimitedFileParser p = new TabDelimitedFileParser("resource/factors/AR-select.txt");
    Set<String> syms = p.getColumnSet(0);

    p = new TabDelimitedFileParser("resource/factors/AR_andr.txt");
    Map<String, String> score = p.getOneToOneMap("Target", "Score");

    Set<String> ids = new HashSet<String>();
    for (String g : syms) ids.add(Triplet.getSymbolToGeneMap().get(g));

    String dir = "resource/expdata/Ling";
View Full Code Here

TOP

Related Classes of gem.parser.TabDelimitedFileParser

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.