private void getNumMappedFlagstat(String flagstatPattern, String dirName) throws IOException{
        numMapped = new HashMap<String, Integer>();
        TextFile flagstat;
        File dir = new File(dirName);
        for (File ch : dir.listFiles()) {
            if (ch.isDirectory()){
                for (File child : ch.listFiles()){
                   if ( (child.getName().equals(flagstatPattern))){
                       flagstat = new TextFile(child.getPath(), false);
                       flagstat.readLine();
                       flagstat.readLine();
                       int num = Integer.parseInt(flagstat.readLineElems(TextFile.space)[0]);
                       String sampleId = ch.getName();
                       numMapped.put(sampleId, num);
                       flagstat.close();
                   }
                }
            }
        }
    }