Jstacs / Jstacs

GNU General Public License v3.0
16 stars 5 forks source link

NullPointerExcetpion in Coverage.print #1

Closed paul-shannon closed 5 years ago

paul-shannon commented 5 years ago

While running the "access" stage, and after lots of processing, the exception was thrown with these arguments and this stack trace. Any advice?

(Perhaps it would be possible to modify the code slightly so that the exception gets caught, and processing continues?)

Parameters of tool "Chromatin accessibility" (access, version: 0.1):
d - Data source (The format of the input file containing the coverage information, range={BAM/SAM, Bigwig}, default = BAM/SAM)  = Bigwig
    Parameters for selection "BAM/SAM":
        i - Input SAM/BAM (The input file containing the mapped DNase-seq/ATAC-seq reads)   = null
    Parameters for selection "Bigwig":
        i - Input Bigwig (The input file containing the mapped DNase-seq/ATAC-seq reads)    = /proj/price4/apaquett/Placenta_DHS/placental_data/dataSets/LN54270/aggregation-17562/Signal.UniqueMultiple.both.bw
        f - FastA index (The genome index)  = hg38.fa.fai
b - Bin width (The width of the genomic bins considered)    = 50
outdir - The output directory, defaults to the current working directory (.)    = dnase
Exception in thread "main" java.lang.NullPointerException
    at projects.encodedream.Coverage.print(Coverage.java:156)
    at projects.encodedream.Coverage.coverage(Coverage.java:113)
    at projects.encodedream.tools.ChromatinAccessibility.run(ChromatinAccessibility.java:121)
    at de.jstacs.tools.ui.cli.CLI.run(CLI.java:374)
    at projects.encodedream.tools.Catchitt.main(Catchitt.java:27)

Which appears to correspond to inner for loop control statement

    private static void print(String chr, double[][] temp, PrintStream out, int bin) {
        for(int i=0;i<temp.length;i++){
            out.print(chr);
            out.print("\t");
            out.print(i*bin);
            for(int j=0;j<temp[i].length;j++){   # line 156
                out.print("\t");
                out.print(temp[i][j]);
            }
            out.println();
        }
    }
jgraux commented 5 years ago

Thanks for reporting this issue. The origin seems to be in the aggregate method and should (hopefully) be fixed now in the sources on github. Would be grateful if you could give it a try.

paul-shannon commented 5 years ago

@jgraux I'd be glad to give this a try. If it is not too bold nor forward of me to ask: before investing more time in catchitt, I would be reassured of my ultimate success if you were able to offer a freshly built jar, and a demonstration/tutorial, with real data, which passes your tests, and which I could run and study and learn from.

jgraux commented 5 years ago

An updated binary and a short tutorial are now available from the Catchitt project page at Jstacs. Feedback appreciated.