Skip to content

Commit

Permalink
Fixed an issue where fetching the header from some bams was causing a
Browse files Browse the repository at this point in the history
null pointer error.
  • Loading branch information
DavidAustinNix committed Mar 31, 2020
1 parent a16fd7f commit 8bd3961
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/edu/utah/seq/parsers/MergePairedAlignments.java
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ private void saveHeader() throws FileNotFoundException, IOException {
SamReaderFactory readerFactory = SamReaderFactory.makeDefault().validationStringency(ValidationStringency.SILENT);
SamReader bamReader = readerFactory.open(bamFile);
SAMFileHeader h = bamReader.getFileHeader();
String[] shLines = Misc.RETURN.split(h.getTextHeader()); //this gets the original header, setting SamSort.unsorted doesn't change it. Ugg.
String[] shLines = Misc.RETURN.split(h.getSAMString()); //this gets the original header, setting SamSort.unsorted doesn't change it. Ugg.
bamReader.close();
for (int i=0; i< shLines.length; i++){
if (shLines[i].contains("SO:coordinate")){
Expand All @@ -418,7 +418,7 @@ private void saveHeader() throws FileNotFoundException, IOException {
public static void printDocs(){
System.out.println("\n" +
"**************************************************************************************\n" +
"** Merge Paired Alignments: Mar 2020 **\n" +
"** Merge Paired Alignments: March 2020 **\n" +
"**************************************************************************************\n" +
"Merges proper paired alignments that pass a variety of checks and thresholds. Only\n" +
"unambiguous pairs will be merged. Increases base calling accuracy in overlap and helps\n" +
Expand Down

0 comments on commit 8bd3961

Please sign in to comment.