Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading the Plink .tfam File is Broken #2

Open
ttbek opened this issue Aug 22, 2017 · 0 comments
Open

Loading the Plink .tfam File is Broken #2

ttbek opened this issue Aug 22, 2017 · 0 comments

Comments

@ttbek
Copy link

ttbek commented Aug 22, 2017

In io_pedigree.py around line 60:

    data = np.genfromtxt(file_name, dtype=np.dtype(int), usecols=range(1, 6))
    print(data)
    nodes, missing = data[:, 0], MISSING
    num_samples, num_columns = data.shape
    if genotyped_ids is None:
        sample_id = nodes

The code seems to assume that this file will be all ints, this is not the case for .tfam in general. Names of individuals like '2_124' are perfectly acceptable in a .tfam file. Naively changing the type to 'str' gave somewhat better results (the data seems to be loading correctly) but the additional parsing may need further correction, here is the traceback:

  File "/media/Storage/NextCloud/Work/Saad/Imputation/Primal_Try_2/ober/code/impute/impute/preprocess/convert.py", line 99, in <module>
    __main(__parse_command_line_args())
  File "/media/Storage/NextCloud/Work/Saad/Imputation/Primal_Try_2/ober/code/impute/impute/preprocess/convert.py", line 79, in __main
    pedigree_genotyped=options.pedigree_genotyped)
  File "/media/Storage/NextCloud/Work/Saad/Imputation/Primal_Try_2/ober/code/impute/impute/data/io.py", line 212, in plink_to_npz
    verbose=verbose)
  File "/media/Storage/NextCloud/Work/Saad/Imputation/Primal_Try_2/ober/code/impute/impute/data/io.py", line 65, in read_plink
    p = io_pedigree.read(pedigree, genotyped_id_file=pedigree_genotyped)
  File "/media/Storage/NextCloud/Work/Saad/Imputation/Primal_Try_2/ober/code/impute/impute/data/io_pedigree.py", line 30, in read
    return __read_pedigree(file_name, genotyped_ids=genotyped_ids)
  File "/media/Storage/NextCloud/Work/Saad/Imputation/Primal_Try_2/ober/code/impute/impute/data/io_pedigree.py", line 111, in __read_pedigree
    graph.remove_node(missing)
  File "/media/Storage/NextCloud/Work/Saad/Imputation/Primal_Try_2/Apps/virtualenv/ober/local/lib/python2.7/site-packages/networkx/classes/digraph.py", line 461, in remove_node
    raise NetworkXError("The node %s is not in the digraph."%(n,))
networkx.exception.NetworkXError: The node -1 is not in the digraph.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant