public void run() { System.out.println("Chromosome " + chrom + " start loading at " + getCurrentTime()); a = ImportUtils.readFromHapmap(filename, chrom); chrInBits = new SBitAlignment(a); System.out.println( "Chromosome " + chrInBits.getLocusName(0) + " is loaded " + getCurrentTime()); }
private void loadAnchorMaps(String anchorFileName) { System.out.println("Alignment Loaded:" + anchorFileName); if (anchorFileName.contains("+") || anchorFileName.contains("=")) { theAnchorChrInBits = new SBitAlignment[ancChrCnt]; LoadChr[] lc = new LoadChr[ancChrCnt]; Thread[] lt = new Thread[ancChrCnt]; for (int i = 0; i < ancChrCnt; i++) { System.out.println("anchorFileName " + anchorFileName); String file = anchorFileName.replace("+", "" + (i + 1)); file = file.replace("=", "" + (i + 1)); System.out.println("Reading:" + file); lc[i] = new LoadChr(file, "" + (i + 1)); lt[i] = new Thread(lc[i]); lt[i].start(); } for (int i = 0; i < lt.length; i++) { try { lt[i].join(); } catch (Exception e) { System.out.println(e.toString()); System.exit(1); } } for (int i = 0; i < lc.length; i++) { theAnchorChrInBits[i] = lc[i].getBitAlignment(); System.out.printf( "Chr %s Sites %d Taxa %d %n", theAnchorChrInBits[i].getLocus(0), theAnchorChrInBits[i].getSiteCount(), theAnchorChrInBits[i].getSequenceCount()); } System.out.println( "maxMemory: " + Runtime.getRuntime().maxMemory() / 1024 / 1024 + "Mb; freeMemory: " + Runtime.getRuntime().freeMemory() / 1024 / 1024 + "Mb"); } else { Alignment[] a = ImportUtils.readFromHapmap(anchorFileName).getAlignments(); theAnchorChrInBits = new SBitAlignment[a.length]; for (int i = 0; i < a.length; i++) { theAnchorChrInBits[i] = new SBitAlignment(a[i]); // System.out.printf("Chr %d Sites %d Taxa %d %n", // theAnchorChrInBits[i].getChr(), // // theAnchorChrInBits[i].getNumSites(),theAnchorChrInBits[i].getNumTaxa()); System.out.printf( "Chr %s Sites %d Taxa %d %n", theAnchorChrInBits[i].getLocus(0), theAnchorChrInBits[i].getSiteCount(), theAnchorChrInBits[i].getSequenceCount()); } } System.out.println("Anchor maps load at " + this.getCurrentTime()); }