Example #1
0
  private void makeClassFile(List<String> classStringList, SampleGroup[] sampleGroups) {
    int totalSample = 0;
    int totalGroup = 0;
    int always = 1;
    int base = 0;
    String line1 = "";
    StringBuffer line2 = new StringBuffer("#");
    StringBuffer line3 = new StringBuffer();
    for (SampleGroup sampleGroup : sampleGroups) {
      totalSample = totalSample + sampleGroup.size();
      totalGroup++;
      line2.append("\t");
      line2.append(sampleGroup.getGroupName());

      makeLine3(line3, sampleGroup, base);
      base++;
    }
    line1 =
        Integer.toString(totalSample)
            + "\t"
            + Integer.toString(totalGroup)
            + "\t"
            + Integer.toString(always);
    classStringList.add(line1);
    classStringList.add(line2.toString());
    classStringList.add(line3.toString());
  }
Example #2
0
 private boolean isIdOverlap(SampleGroup[] sampleGroups) {
   SampleGroup samples = new SampleGroup();
   int total = 0;
   for (SampleGroup sampleGroup : sampleGroups) {
     total = total + sampleGroup.size();
     samples.addAll(sampleGroup);
   }
   if (total > samples.size()) return true;
   return false;
 }
Example #3
0
 private void makeLine3(StringBuffer sb, SampleGroup sampleGroup, int base) {
   int total = 0;
   for (Iterator i = sampleGroup.iterator(); i.hasNext(); ) {
     String id = (String) i.next();
     // sb.append(DOUBLE_QUOTE+(String)i.next()+DOUBLE_QUOTE);
     if (base == 0 && total == 0) {
       sb.append(base);
     } else {
       sb.append("\t");
       sb.append(base);
     }
     total++;
   }
 }