1、使用MarkDuplicates命令时。
Exception in thread "main" htsjdk.samtools.SAMException: /TJPROJ6/AFS_RESEQ/Proj/liangjifeng/5.mRNA/X101SC23092911-Z01-J005.20240407.RNAmapping_unmapNR/mapping/101/tmp/CSPI.4553797415123961586.tmp/12125.tmpnot found at htsjdk.samtools.util.FileAppendStreamLRUCache$Functor.makeValue(FileAppendStreamLRUCache.java:64) at htsjdk.samtools.util.FileAppendStreamLRUCache$Functor.makeValue(FileAppendStreamLRUCache.java:49) at htsjdk.samtools.util.ResourceLimitedMap.get(ResourceLimitedMap.java:76) at htsjdk.samtools.CoordinateSortedPairInfoMap.getOutputStreamForSequence(CoordinateSortedPairInfoMap.java:180) at htsjdk.samtools.CoordinateSortedPairInfoMap.put(CoordinateSortedPairInfoMap.java:164) at picard.sam.markduplicates.util.DiskBasedReadEndsForMarkDuplicatesMap.put(DiskBasedReadEndsForMarkDuplicatesMap.java:65) at picard.sam.markduplicates.MarkDuplicates.buildSortedReadEndLists(MarkDuplicates.java:566) at picard.sam.markduplicates.MarkDuplicates.doWork(MarkDuplicates.java:257) at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:301) at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:103) at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:113) Caused by: java.io.FileNotFoundException: /TJPROJ6/AFS_RESEQ/Proj/liangjifeng/5.mRNA/X101SC23092911-Z01-J005.20240407.RNAmapping_unmapNR/mapping/101/tmp/CSPI.4553797415123961586.tmp/12125.tmp (Too many open files) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:213) at htsjdk.samtools.util.FileAppendStreamLRUCache$Functor.makeValue(FileAppendStreamLRUCache.java:61) ... 10 more
由于打开文件个数超出系统限制,解决办法增加参数即可:
MAX_RECORDS_IN_RAM=1000000 MAX_FILE_HANDLES_FOR_READ_ENDS_MAP=1000
2.Picard 内存不够
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at htsjdk.samtools.util.BlockCompressedInputStream.inflateBlock(BlockCompressedInputStream.java:548) at htsjdk.samtools.util.BlockCompressedInputStream.processNextBlock(BlockCompressedInputStream.java:532) at htsjdk.samtools.util.BlockCompressedInputStream.nextBlock(BlockCompressedInputStream.java:468) at htsjdk.samtools.util.BlockCompressedInputStream.readBlock(BlockCompressedInputStream.java:458) at htsjdk.samtools.util.BlockCompressedInputStream.available(BlockCompressedInputStream.java:196) at htsjdk.samtools.util.BlockCompressedInputStream.read(BlockCompressedInputStream.java:331) at java.base/java.io.DataInputStream.read(DataInputStream.java:149) at htsjdk.samtools.util.BinaryCodec.readBytesOrFewer(BinaryCodec.java:421) at htsjdk.samtools.util.BinaryCodec.readBytes(BinaryCodec.java:394) at htsjdk.samtools.util.BinaryCodec.readByteBuffer(BinaryCodec.java:507) at htsjdk.samtools.util.BinaryCodec.readInt(BinaryCodec.java:518) at htsjdk.samtools.BAMRecordCodec.decode(BAMRecordCodec.java:261) at htsjdk.samtools.BAMFileReader$BAMFileIterator.getNextRecord(BAMFileReader.java:866) at htsjdk.samtools.BAMFileReader$BAMFileIterator.advance(BAMFileReader.java:840) at htsjdk.samtools.BAMFileReader$BAMFileIterator.next(BAMFileReader.java:834) at htsjdk.samtools.BAMFileReader$BAMFileIterator.next(BAMFileReader.java:802) at htsjdk.samtools.SamReader$AssertingIterator.next(SamReader.java:574) at htsjdk.samtools.SamReader$AssertingIterator.next(SamReader.java:553) at picard.sam.markduplicates.MarkDuplicates.buildSortedReadEndLists(MarkDuplicates.java:524) at picard.sam.markduplicates.MarkDuplicates.doWork(MarkDuplicates.java:257) at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:301) at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:103) at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:113)
由于内存不够引起,可以增加参数
picard -Xmx20G -XX:ParallelGCThreads=4 CollectRnaSeqMetrics