copySamFileHeader() utility function

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1154 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
depristo 2009-07-02 12:55:51 +00:00
parent bb92eb8b1c
commit 6684cb8bc9
1 changed files with 14 additions and 0 deletions

View File

@ -65,6 +65,20 @@ public class Utils {
logger.warn(String.format("* %s", builder));
}
public static SAMFileHeader copySAMFileHeader( SAMFileHeader toCopy ) {
SAMFileHeader copy = new SAMFileHeader();
copy.setSortOrder(toCopy.getSortOrder());
copy.setGroupOrder(toCopy.getGroupOrder());
copy.setProgramRecords(toCopy.getProgramRecords());
copy.setReadGroups(toCopy.getReadGroups());
copy.setSequenceDictionary(toCopy.getSequenceDictionary());
for ( Map.Entry<String, Object> e : toCopy.getAttributes())
copy.setAttribute(e.getKey(), e.getValue());
return copy;
}
public static SAMFileWriter createSAMFileWriterWithCompression(SAMFileHeader header, boolean presorted, String file, int compression) {
if (file.endsWith(".bam"))