Allow the use of getSAMString on SAMReadGroupRecord objects #827
Merged
lbergelson
merged 2 commits into
samtools:master
from
Lenbok:SAMReadGroupRecord-getSAMString
Mar 24, 2017
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
Jump to file or symbol
Failed to load files and symbols.
| @@ -0,0 +1,42 @@ | ||
| +/* | ||
| + * The MIT License | ||
| + * | ||
| + * Copyright (c) 2017 The Broad Institute | ||
| + * | ||
| + * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| + * of this software and associated documentation files (the "Software"), to deal | ||
| + * in the Software without restriction, including without limitation the rights | ||
| + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| + * copies of the Software, and to permit persons to whom the Software is | ||
| + * furnished to do so, subject to the following conditions: | ||
| + * | ||
| + * The above copyright notice and this permission notice shall be included in | ||
| + * all copies or substantial portions of the Software. | ||
| + * | ||
| + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| + * THE SOFTWARE. | ||
| + */ | ||
| +package htsjdk.samtools; | ||
| + | ||
| +import org.testng.Assert; | ||
| +import org.testng.annotations.Test; | ||
| + | ||
| +/** | ||
| + * Test for SAMReadGroupRecordTest | ||
| + */ | ||
| +public class SAMProgramRecordTest { | ||
| + | ||
| + @Test | ||
| + public void testGetSAMString() { | ||
| + SAMProgramRecord r = new SAMProgramRecord("SW-eIV"); | ||
| + r.setProgramName("telnet"); | ||
| + r.setProgramVersion("0.17-40"); | ||
| + r.setCommandLine("telnet towel.blinkenlights.nl"); | ||
| + Assert.assertEquals("@PG\tID:SW-eIV\tPN:telnet\tVN:0.17-40\tCL:telnet towel.blinkenlights.nl", r.getSAMString()); | ||
| + } | ||
| +} |
| @@ -0,0 +1,42 @@ | ||
| +/* | ||
| + * The MIT License | ||
| + * | ||
| + * Copyright (c) 2017 The Broad Institute | ||
| + * | ||
| + * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| + * of this software and associated documentation files (the "Software"), to deal | ||
| + * in the Software without restriction, including without limitation the rights | ||
| + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| + * copies of the Software, and to permit persons to whom the Software is | ||
| + * furnished to do so, subject to the following conditions: | ||
| + * | ||
| + * The above copyright notice and this permission notice shall be included in | ||
| + * all copies or substantial portions of the Software. | ||
| + * | ||
| + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| + * THE SOFTWARE. | ||
| + */ | ||
| +package htsjdk.samtools; | ||
| + | ||
| +import org.testng.Assert; | ||
| +import org.testng.annotations.Test; | ||
| + | ||
| +/** | ||
| + * Test for SAMReadGroupRecordTest | ||
| + */ | ||
| +public class SAMReadGroupRecordTest { | ||
| + | ||
| + @Test | ||
| + public void testGetSAMString() { | ||
| + SAMReadGroupRecord r = new SAMReadGroupRecord("rg1"); | ||
| + r.setSample("mysample"); | ||
| + r.setPlatform("ILLUMINA"); | ||
| + r.setDescription("my description"); | ||
| + Assert.assertEquals("@RG\tID:rg1\tSM:mysample\tPL:ILLUMINA\tDS:my description", r.getSAMString()); | ||
| + } | ||
| +} |
| @@ -0,0 +1,42 @@ | ||
| +/* | ||
| + * The MIT License | ||
| + * | ||
| + * Copyright (c) 2017 The Broad Institute | ||
| + * | ||
| + * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| + * of this software and associated documentation files (the "Software"), to deal | ||
| + * in the Software without restriction, including without limitation the rights | ||
| + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| + * copies of the Software, and to permit persons to whom the Software is | ||
| + * furnished to do so, subject to the following conditions: | ||
| + * | ||
| + * The above copyright notice and this permission notice shall be included in | ||
| + * all copies or substantial portions of the Software. | ||
| + * | ||
| + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| + * THE SOFTWARE. | ||
| + */ | ||
| +package htsjdk.samtools; | ||
| + | ||
| +import org.testng.Assert; | ||
| +import org.testng.annotations.Test; | ||
| + | ||
| +/** | ||
| + * Test for SAMReadGroupRecordTest | ||
| + */ | ||
| +public class SAMSequenceRecordTest { | ||
| + | ||
| + @Test | ||
| + public void testGetSAMString() { | ||
| + SAMSequenceRecord r = new SAMSequenceRecord("chr5_but_without_a_prefix", 271828); | ||
| + r.setSpecies("Psephophorus terrypratchetti"); | ||
| + r.setAssembly("GRCt01"); | ||
| + r.setMd5("7a6dd3d307de916b477e7bf304ac22bc"); | ||
| + Assert.assertEquals("@SQ\tSN:chr5_but_without_a_prefix\tLN:271828\tSP:Psephophorus terrypratchetti\tAS:GRCt01\tM5:7a6dd3d307de916b477e7bf304ac22bc", r.getSAMString()); | ||
| + } | ||
| +} |