{"action":"created","comment":{"url":"https://api.github.com/repos/broadinstitute/hellbender/pulls/comments/37793544","id":37793544,"diff_hunk":"@@ -0,0 +1,325 @@\n+package org.broadinstitute.hellbender.engine.samples;\n+\n+import java.io.*;\n+import java.util.*;\n+\n+import org.apache.logging.log4j.Logger;\n+import org.apache.logging.log4j.LogManager;\n+import org.broadinstitute.hellbender.utils.Utils;\n+import org.broadinstitute.hellbender.exceptions.GATKException;\n+import org.broadinstitute.hellbender.exceptions.UserException;\n+import org.broadinstitute.hellbender.utils.text.XReadLines;\n+\n+/**\n+ * Reads PED file-formatted tabular text files\n+ *\n+ * See http://www.broadinstitute.org/mpg/tagger/faq.html\n+ * See http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#ped\n+ *\n+ * The \"ped\" file format refers to the widely-used format for linkage pedigree data.\n+ * Each line describes a single (diploid) individual in the following format:\n+ *\n+ *      family_ID individual_ID father_ID mother_ID gender phenotype genotype_1 genotype_2 ...\n+ *\n+ * If your data lacks pedigree information (for example, unrelated case/control individuals),\n+ * set the father_ID and mother_ID to 0. sex denotes the individual's gender with 1=male and 2=female.\n+ * phenotype refers to the affected status (for association studies) where 0=unknown, 1=unaffected, 2=affected.\n+ * Finally, each genotype is written as two (=diploid) integer numbers (separated by whitespace),\n+ * where 1=A, 2=C, 3=G, 4=T. No header lines are allowed and all columns must be separated by whitespace.\n+ * Check out the information at the PLINK website on the \"ped\" file format.\n+ *\n+ * The PED file is a white-space (space or tab) delimited file: the first six columns are mandatory:\n+ *  Family ID\n+ *  Individual ID\n+ *  Paternal ID\n+ *  Maternal ID\n+ *  Sex (1=male; 2=female; other=unknown)\n+ *  Phenotype\n+ *\n+ *  The IDs are alphanumeric: the combination of family and individual ID should uniquely identify a person.\n+ *  A PED file must have 1 and only 1 phenotype in the sixth column. The phenotype can be either a\n+ *  quantitative trait or an affection status column: PLINK will automatically detect which type\n+ *  (i.e. based on whether a value other than 0, 1, 2 or the missing genotype code is observed).\n+ *  Note that the GATK actually supports arbitrary values for quantitative trait -- not just doubles --\n+ *  and are actually representing these values as strings instead of doubles\n+ *\n+ *  NOTE Quantitative traits with decimal points must be coded with a period/full-stop character and\n+ *  not a comma, i.e. 2.394 not 2,394\n+ *\n+ *  If an individual's sex is unknown, then any character other than 1 or 2 can be used.\n+ *  When new files are created (PED, FAM, or other which contain sex) then the original coding will be\n+ *  preserved. However, these individuals will be dropped from any analyses (i.e. phenotype set to missing also)\n+ *  and an error message will arise if an analysis that uses family information is requested and an\n+ *  individual of 'unknown' sex is specified as a father or mother.\n+ *\n+ *\n+ *  HINT You can add a comment to a PED or MAP file by starting the line with a # character. The rest of that\n+ *  line will be ignored. Do not start any family IDs with this character therefore.\n+ *\n+ *  Affection status, by default, should be coded:\n+ *  -9 missing\n+ *   0 missing\n+ *   1 unaffected\n+ *   2 affected\n+ *\n+ * If your file is coded 0/1 to represent unaffected/affected, then use the --1 flag:\n+ * plink --file mydata --1 which will specify a disease phenotype coded:\n+ *\n+ *  -9 missing\n+ *  0 unaffected\n+ *  1 affected\n+ *\n+ * The missing phenotype value for quantitative traits is, by default, -9 (this can also be used for\n+ * disease traits as well as 0). It can be reset by including the --missing-phenotype option:\n+ *\n+ * Genotypes (column 7 onwards) should also be white-space delimited; they can be any character\n+ * (e.g. 1,2,3,4 or A,C,G,T or anything else) except 0 which is, by default, the missing genotype\n+ * character. All markers should be biallelic. All SNPs (whether haploid or not) must have two\n+ * alleles specified. Either Both alleles should be missing (i.e. 0) or neither.\n+ *\n+ * No header row should be given. For example, here are two individuals typed for 3 SNPs (one row = one person):\n+ *\n+ *   FAM001  1  0 0  1  2  A A  G G  A C\n+ *   FAM001  2  0 0  1  2  A A  A G  0 0\n+ *   ...\n+ *\n+ * Note that the GATK does not support genotypes in a PED file.\n+ *\n+ * @author Mark DePristo\n+ * @since 2011\n+ */\n+public class PedReader {\n+    private static Logger logger = LogManager.getLogger(PedReader.class);\n+    final static private Set<String> CATAGORICAL_TRAIT_VALUES = new HashSet<String>(Arrays.asList(\"-9\", \"0\", \"1\", \"2\"));","path":"src/main/java/org/broadinstitute/hellbender/engine/samples/PedReader.java","position":93,"original_position":93,"commit_id":"17e3147536227e7961917fa477438fae8601dbbe","original_commit_id":"17e3147536227e7961917fa477438fae8601dbbe","user":{"login":"lbergelson","id":4700332,"avatar_url":"https://avatars.githubusercontent.com/u/4700332?v=3","gravatar_id":"","url":"https://api.github.com/users/lbergelson","html_url":"https://github.com/lbergelson","followers_url":"https://api.github.com/users/lbergelson/followers","following_url":"https://api.github.com/users/lbergelson/following{/other_user}","gists_url":"https://api.github.com/users/lbergelson/gists{/gist_id}","starred_url":"https://api.github.com/users/lbergelson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbergelson/subscriptions","organizations_url":"https://api.github.com/users/lbergelson/orgs","repos_url":"https://api.github.com/users/lbergelson/repos","events_url":"https://api.github.com/users/lbergelson/events{/privacy}","received_events_url":"https://api.github.com/users/lbergelson/received_events","type":"User","site_admin":false},"body":"This should be declared using the named constants down below.  ","created_at":"2015-08-24T19:29:35Z","updated_at":"2015-08-24T19:29:35Z","html_url":"https://github.com/broadinstitute/hellbender/pull/792#discussion_r37793544","pull_request_url":"https://api.github.com/repos/broadinstitute/hellbender/pulls/792","_links":{"self":{"href":"https://api.github.com/repos/broadinstitute/hellbender/pulls/comments/37793544"},"html":{"href":"https://github.com/broadinstitute/hellbender/pull/792#discussion_r37793544"},"pull_request":{"href":"https://api.github.com/repos/broadinstitute/hellbender/pulls/792"}}},"pull_request":{"url":"https://api.github.com/repos/broadinstitute/hellbender/pulls/792","id":41921234,"html_url":"https://github.com/broadinstitute/hellbender/pull/792","diff_url":"https://github.com/broadinstitute/hellbender/pull/792.diff","patch_url":"https://github.com/broadinstitute/hellbender/pull/792.patch","issue_url":"https://api.github.com/repos/broadinstitute/hellbender/issues/792","number":792,"state":"open","locked":false,"title":"Port SelectVariants tool and dependent infrastructure.","user":{"login":"cmnbroad","id":10062863,"avatar_url":"https://avatars.githubusercontent.com/u/10062863?v=3","gravatar_id":"","url":"https://api.github.com/users/cmnbroad","html_url":"https://github.com/cmnbroad","followers_url":"https://api.github.com/users/cmnbroad/followers","following_url":"https://api.github.com/users/cmnbroad/following{/other_user}","gists_url":"https://api.github.com/users/cmnbroad/gists{/gist_id}","starred_url":"https://api.github.com/users/cmnbroad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmnbroad/subscriptions","organizations_url":"https://api.github.com/users/cmnbroad/orgs","repos_url":"https://api.github.com/users/cmnbroad/repos","events_url":"https://api.github.com/users/cmnbroad/events{/privacy}","received_events_url":"https://api.github.com/users/cmnbroad/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-07T18:44:03Z","updated_at":"2015-08-24T19:29:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2db82528b81c31dbd5614cdf38fcd60b4a1d9c64","assignee":{"login":"droazen","id":798637,"avatar_url":"https://avatars.githubusercontent.com/u/798637?v=3","gravatar_id":"","url":"https://api.github.com/users/droazen","html_url":"https://github.com/droazen","followers_url":"https://api.github.com/users/droazen/followers","following_url":"https://api.github.com/users/droazen/following{/other_user}","gists_url":"https://api.github.com/users/droazen/gists{/gist_id}","starred_url":"https://api.github.com/users/droazen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/droazen/subscriptions","organizations_url":"https://api.github.com/users/droazen/orgs","repos_url":"https://api.github.com/users/droazen/repos","events_url":"https://api.github.com/users/droazen/events{/privacy}","received_events_url":"https://api.github.com/users/droazen/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/broadinstitute/hellbender/pulls/792/commits","review_comments_url":"https://api.github.com/repos/broadinstitute/hellbender/pulls/792/comments","review_comment_url":"https://api.github.com/repos/broadinstitute/hellbender/pulls/comments{/number}","comments_url":"https://api.github.com/repos/broadinstitute/hellbender/issues/792/comments","statuses_url":"https://api.github.com/repos/broadinstitute/hellbender/statuses/17e3147536227e7961917fa477438fae8601dbbe","head":{"label":"broadinstitute:cn_select_variants","ref":"cn_select_variants","sha":"17e3147536227e7961917fa477438fae8601dbbe","user":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"repo":{"id":27452807,"name":"hellbender","full_name":"broadinstitute/hellbender","owner":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/broadinstitute/hellbender","description":"GATK4 development","fork":false,"url":"https://api.github.com/repos/broadinstitute/hellbender","forks_url":"https://api.github.com/repos/broadinstitute/hellbender/forks","keys_url":"https://api.github.com/repos/broadinstitute/hellbender/keys{/key_id}","collaborators_url":"https://api.github.com/repos/broadinstitute/hellbender/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/broadinstitute/hellbender/teams","hooks_url":"https://api.github.com/repos/broadinstitute/hellbender/hooks","issue_events_url":"https://api.github.com/repos/broadinstitute/hellbender/issues/events{/number}","events_url":"https://api.github.com/repos/broadinstitute/hellbender/events","assignees_url":"https://api.github.com/repos/broadinstitute/hellbender/assignees{/user}","branches_url":"https://api.github.com/repos/broadinstitute/hellbender/branches{/branch}","tags_url":"https://api.github.com/repos/broadinstitute/hellbender/tags","blobs_url":"https://api.github.com/repos/broadinstitute/hellbender/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/broadinstitute/hellbender/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/broadinstitute/hellbender/git/refs{/sha}","trees_url":"https://api.github.com/repos/broadinstitute/hellbender/git/trees{/sha}","statuses_url":"https://api.github.com/repos/broadinstitute/hellbender/statuses/{sha}","languages_url":"https://api.github.com/repos/broadinstitute/hellbender/languages","stargazers_url":"https://api.github.com/repos/broadinstitute/hellbender/stargazers","contributors_url":"https://api.github.com/repos/broadinstitute/hellbender/contributors","subscribers_url":"https://api.github.com/repos/broadinstitute/hellbender/subscribers","subscription_url":"https://api.github.com/repos/broadinstitute/hellbender/subscription","commits_url":"https://api.github.com/repos/broadinstitute/hellbender/commits{/sha}","git_commits_url":"https://api.github.com/repos/broadinstitute/hellbender/git/commits{/sha}","comments_url":"https://api.github.com/repos/broadinstitute/hellbender/comments{/number}","issue_comment_url":"https://api.github.com/repos/broadinstitute/hellbender/issues/comments{/number}","contents_url":"https://api.github.com/repos/broadinstitute/hellbender/contents/{+path}","compare_url":"https://api.github.com/repos/broadinstitute/hellbender/compare/{base}...{head}","merges_url":"https://api.github.com/repos/broadinstitute/hellbender/merges","archive_url":"https://api.github.com/repos/broadinstitute/hellbender/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/broadinstitute/hellbender/downloads","issues_url":"https://api.github.com/repos/broadinstitute/hellbender/issues{/number}","pulls_url":"https://api.github.com/repos/broadinstitute/hellbender/pulls{/number}","milestones_url":"https://api.github.com/repos/broadinstitute/hellbender/milestones{/number}","notifications_url":"https://api.github.com/repos/broadinstitute/hellbender/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/broadinstitute/hellbender/labels{/name}","releases_url":"https://api.github.com/repos/broadinstitute/hellbender/releases{/id}","created_at":"2014-12-02T20:50:36Z","updated_at":"2015-08-12T03:14:08Z","pushed_at":"2015-08-24T19:22:53Z","git_url":"git://github.com/broadinstitute/hellbender.git","ssh_url":"git@github.com:broadinstitute/hellbender.git","clone_url":"https://github.com/broadinstitute/hellbender.git","svn_url":"https://github.com/broadinstitute/hellbender","homepage":"","size":39106,"stargazers_count":29,"watchers_count":29,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":242,"forks":8,"open_issues":242,"watchers":29,"default_branch":"master"}},"base":{"label":"broadinstitute:master","ref":"master","sha":"f1056cbb0b46851e4c5f32b27bfe196fef7a6d00","user":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"repo":{"id":27452807,"name":"hellbender","full_name":"broadinstitute/hellbender","owner":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/broadinstitute/hellbender","description":"GATK4 development","fork":false,"url":"https://api.github.com/repos/broadinstitute/hellbender","forks_url":"https://api.github.com/repos/broadinstitute/hellbender/forks","keys_url":"https://api.github.com/repos/broadinstitute/hellbender/keys{/key_id}","collaborators_url":"https://api.github.com/repos/broadinstitute/hellbender/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/broadinstitute/hellbender/teams","hooks_url":"https://api.github.com/repos/broadinstitute/hellbender/hooks","issue_events_url":"https://api.github.com/repos/broadinstitute/hellbender/issues/events{/number}","events_url":"https://api.github.com/repos/broadinstitute/hellbender/events","assignees_url":"https://api.github.com/repos/broadinstitute/hellbender/assignees{/user}","branches_url":"https://api.github.com/repos/broadinstitute/hellbender/branches{/branch}","tags_url":"https://api.github.com/repos/broadinstitute/hellbender/tags","blobs_url":"https://api.github.com/repos/broadinstitute/hellbender/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/broadinstitute/hellbender/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/broadinstitute/hellbender/git/refs{/sha}","trees_url":"https://api.github.com/repos/broadinstitute/hellbender/git/trees{/sha}","statuses_url":"https://api.github.com/repos/broadinstitute/hellbender/statuses/{sha}","languages_url":"https://api.github.com/repos/broadinstitute/hellbender/languages","stargazers_url":"https://api.github.com/repos/broadinstitute/hellbender/stargazers","contributors_url":"https://api.github.com/repos/broadinstitute/hellbender/contributors","subscribers_url":"https://api.github.com/repos/broadinstitute/hellbender/subscribers","subscription_url":"https://api.github.com/repos/broadinstitute/hellbender/subscription","commits_url":"https://api.github.com/repos/broadinstitute/hellbender/commits{/sha}","git_commits_url":"https://api.github.com/repos/broadinstitute/hellbender/git/commits{/sha}","comments_url":"https://api.github.com/repos/broadinstitute/hellbender/comments{/number}","issue_comment_url":"https://api.github.com/repos/broadinstitute/hellbender/issues/comments{/number}","contents_url":"https://api.github.com/repos/broadinstitute/hellbender/contents/{+path}","compare_url":"https://api.github.com/repos/broadinstitute/hellbender/compare/{base}...{head}","merges_url":"https://api.github.com/repos/broadinstitute/hellbender/merges","archive_url":"https://api.github.com/repos/broadinstitute/hellbender/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/broadinstitute/hellbender/downloads","issues_url":"https://api.github.com/repos/broadinstitute/hellbender/issues{/number}","pulls_url":"https://api.github.com/repos/broadinstitute/hellbender/pulls{/number}","milestones_url":"https://api.github.com/repos/broadinstitute/hellbender/milestones{/number}","notifications_url":"https://api.github.com/repos/broadinstitute/hellbender/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/broadinstitute/hellbender/labels{/name}","releases_url":"https://api.github.com/repos/broadinstitute/hellbender/releases{/id}","created_at":"2014-12-02T20:50:36Z","updated_at":"2015-08-12T03:14:08Z","pushed_at":"2015-08-24T19:22:53Z","git_url":"git://github.com/broadinstitute/hellbender.git","ssh_url":"git@github.com:broadinstitute/hellbender.git","clone_url":"https://github.com/broadinstitute/hellbender.git","svn_url":"https://github.com/broadinstitute/hellbender","homepage":"","size":39106,"stargazers_count":29,"watchers_count":29,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":242,"forks":8,"open_issues":242,"watchers":29,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/broadinstitute/hellbender/pulls/792"},"html":{"href":"https://github.com/broadinstitute/hellbender/pull/792"},"issue":{"href":"https://api.github.com/repos/broadinstitute/hellbender/issues/792"},"comments":{"href":"https://api.github.com/repos/broadinstitute/hellbender/issues/792/comments"},"review_comments":{"href":"https://api.github.com/repos/broadinstitute/hellbender/pulls/792/comments"},"review_comment":{"href":"https://api.github.com/repos/broadinstitute/hellbender/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/broadinstitute/hellbender/pulls/792/commits"},"statuses":{"href":"https://api.github.com/repos/broadinstitute/hellbender/statuses/17e3147536227e7961917fa477438fae8601dbbe"}}}}