public void readCounts() throws IOException{
        System.out.println("started processing " + dirName);
	TextFile in = null;
	String line = "";
        String[] splLine;
        
        int index = 0;
        
        //all genes from bed12, sorted
        //allTranscr = getAllTranscripts();
        getAllGenes();
        Collections.sort(allTranscr);
        
        //all files to use
        ArrayList<String> fNames = getFileNames();
        
        trSize = allTranscr.size(); //number of transcripts
        samplesSize = fNames.size(); //number of samples
        //table with only counts
        float[][] table = new float[trSize][samplesSize];
        readsPerSample = new float[samplesSize];
        sampleNames = new String[samplesSize];
        featureExpressed = new boolean[trSize];
        //table=fill(table);//fill with empty strings
        
        int curId = 0;
        System.out.println("started generating the expression table");
        String trId;
        for (String fName : fNames){
            int rCount=0;
            in = new TextFile(fName, false);
            //getting sample name from the file name
            System.out.println("processing file: " + fName);
            String sampleId="";
            String[] splName = fName.split("/");
            sampleId = splName[splName.length - 2];
            
            sampleNames[curId] = sampleId;
            
            //get number of mapped reads from filtered sam file
            readsPerSample[curId] = getNumMappedReads(fName);
            //in.readLine();
            while ((line = in.readLine()) != null){
                    splLine = line.split("\t");
                    trId = splLine[0];
                    if (trId != null){
                        float count = Float.valueOf(splLine[1]);
                        //System.out.println(trId);

                        //get the transcript position in all transcripts list 
                        index = Collections.binarySearch(allTranscr, trId);
                        
                        if (index >= 0){ //if transcript found
                            if (count > 0){
                                featureExpressed[index] = true; //set this feature as expressed
                                rCount+=count; //junk
                                table[index][curId] += count;
                            }
                        }   
                    }
            }
            curId++;
            System.out.println("overall number of reads=" + rCount);
            System.out.println("overall number of mapped reads=" + readsPerSample[curId - 1]);
            in.close();
            
        }
        //print the result
        printTable(table);
       
    }