toks = getReadNameTokens(readName2, 2, freader2);
final String baseName2 = toks[0] ;
final String num2 = toks[1];
if (!baseName1.equals(baseName2)) {
throw new PicardException(String.format("In paired mode, read name 1 (%s) does not match read name 2 (%s)", baseName1,baseName2));
}
final boolean num1Blank = StringUtil.isBlank(num1);
final boolean num2Blank = StringUtil.isBlank(num2);
if (num1Blank || num2Blank) {
if(!num1Blank) throw new PicardException(error(freader1,"Pair 1 number is missing (" +readName1+ "). Both pair numbers must be present or neither.")); //num1 != blank and num2 == blank
else if(!num2Blank) throw new PicardException(error(freader2, "Pair 2 number is missing (" +readName2+ "). Both pair numbers must be present or neither.")); //num1 == blank and num =2 != blank
} else {
if (!num1.equals("1")) throw new PicardException(error(freader1,"Pair 1 number must be 1 ("+readName1+")"));
if (!num2.equals("2")) throw new PicardException(error(freader2,"Pair 2 number must be 2 ("+readName2+")"));
}
return baseName1 ;
}