Package gem.parser

Examples of gem.parser.TabDelimitedFileParser


    return filtered;
  }

  public static List<Triplet> getAndrogenApprovedTrips() throws Throwable
  {
    TabDelimitedFileParser parser = new TabDelimitedFileParser("resource/factors/AR_andr.txt");
    Map<String, String> score = parser.getOneToOneMap("Target", "Score");

    String tripFile = "result/Result_fdr0.05_var10.0_AR_expo_select.xls";

    List<Triplet> trips = Triplet.readTrips(tripFile);
    for (Triplet t : trips) t.backFromURLToIDs();
View Full Code Here


  }

  private static void filterSignsOfAndrRespTrips()
  {
    List<Triplet> trips = Triplet.readTrips("result/Result_fdr0.05_var10.0_AR_expo_andr.xls");
    TabDelimitedFileParser parser = new TabDelimitedFileParser("resource/factors/AR_andr.txt");
    Map<String, String> score = parser.getOneToOneMap("Target", "Score");

    List<Triplet> list = new ArrayList<Triplet>();

    for (Triplet t : trips)
    {
View Full Code Here

  private static Collection<Gene> getARTargets(String dir) throws Throwable
  {
//    TabDelimitedFileParser parser = new TabDelimitedFileParser("resource/factors/AR.txt");

    TabDelimitedFileParser parser = new TabDelimitedFileParser("resource/NuclearReceptors.txt");
    Set<String> targets = parser.getColumnSet(0);
//
    Set<String> ids = new HashSet<String>();

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

    }
  }

  public static void removeBadFOXA1Tars(List<Triplet> trips)
  {
    TabDelimitedFileParser parser = new TabDelimitedFileParser("resource/expdata/Ling/FOXA1-tars.txt");
    Set<String> tars = parser.getColumnSet(0);
    Iterator<Triplet> iter = trips.iterator();
    while (iter.hasNext())
    {
      Triplet t = iter.next();
      if (t.getMSym().equals("FOXA1") && !tars.contains(t.getTSym()))
View Full Code Here

  public static void compare() throws IOException
  {
    String dir = "resource/expdata/GSE847/";

    TabDelimitedFileParser p = new TabDelimitedFileParser(dir + "platform.txt");
    Map<String,String> id2sym = p.getOneToOneMap("ID", "Gene Symbol");

    boolean[][] pos = StageAnalyzer.getPos(dir);
    int ind1 = 0;
    int ind2 = 1;
View Full Code Here

  private static void printGeneVals(String sym, String dir) throws IOException
  {
    Map<String,Set<String>> sym2id;
    if ((new File(dir + "platform.txt").exists()))
    {
      TabDelimitedFileParser p = new TabDelimitedFileParser(dir + "platform.txt");
      sym2id = p.getOneToManyMap("Gene Symbol", "ID");
    }
    else sym2id = new HashMap<String, Set<String>>();

    String egID = Triplet.getSymbolToGeneMap().get(sym);
View Full Code Here

    }
  }

  private static void fillChangeMaps(Collection<Triplet> trips)
  {
    TabDelimitedFileParser parser =
      new TabDelimitedFileParser("resource/expop/deviated-in-cancer-AR.txt");

    Map<String, String> deviationMap = parser.getOneToOneMap("ID", "PresenceInNormal");

    for (Triplet t : trips)
    {
      if (!gene2change.containsKey(t.M)) putToChangeMap(t.M);
      if (!gene2change.containsKey(t.F)) putToChangeMap(t.F);
View Full Code Here

  }

  public static Map<String, List<double[]>> readCross(String platfile, String datafile,
    Set<String> egIDs) throws Throwable
  {
    TabDelimitedFileParser parser = new TabDelimitedFileParser(platfile);

    String[] egCols = new String[]{"ENTREZ_GENE_ID", "Entrez_Gene_ID", "GENE_SYMBOL", "GENE"};
    String egCol = null;
    for (String col : egCols)
    {
      if (FileUtil.columnsLineContains(platfile, col))
      {
        egCol = col;
        break;
      }
    }

    Map<String, Set<String>> eg2id = parser.getOneToManyMap(egCol, "ID");

    Map<String, String> g2s = Triplet.getGeneToSymbolMap();
    Set<String> idSet = new HashSet<String>();
    for (String eg : egIDs)
    {
View Full Code Here

  public static Set<String> getGSE6919Select(String... words)
  {
    Set<String> set = new HashSet<String>();

    TabDelimitedFileParser parser = new TabDelimitedFileParser(
      "resource/expdata/GSE6919/exptypes.txt");

    Map<String, String> map = parser.getOneToOneMap("ID", "Description");

    for (String exp : map.keySet())
    {
      String desc = map.get(exp);
View Full Code Here

    return p;
  }

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

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

    for (String s : new HashSet<String>(tarSym))
    {
      assert score.containsKey(s);
      if (score.get(s).startsWith("-"))
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.