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

Refactor #6

Merged
merged 6 commits into from
Feb 23, 2024
Merged

Refactor #6

merged 6 commits into from
Feb 23, 2024

Conversation

jtb324
Copy link

@jtb324 jtb324 commented Feb 23, 2024

updated version of DRIVE that catches the error when the graphs cannot be properly constructed because individuals do not share pairwise IBD segments with each other

jtb324 added 6 commits January 8, 2024 15:34
…umn in a matrix

Added a new property to the PhenotypeFileParser called specific_phenotype. This property allows the user to provided a specific phenotype name to the drive program using the argument '--phenotype-name'. This change allows the user to specify a specific phenotype column from a file without having to recreate a bunch of phenotype files.
…not identifying the appropriate index if the user only wished to find a specific haplotype

The parser would attempt to get the appropriate index of where the phenotype value was in the list. By default it starts at zero but if the user only want to specify a specific column then a bug appeared where if the user specified a column such as 10, the parser would attempt to first get the value at index 0 which would return a none value. This none value would then cause the latter code to fail.
…ng ibd file chunks

When the id columns were numeric instead of alpha-numeric, pandas would read in the columns as mixed type. This affected a downstream process were the ids and phase value are concatenated because an type error was being thrown.
…hared pairwise IBD segments and graph was improperly formed

There was an edge case that when the redopd was formed it would be empty. This emptiness would be caused when none of the individuals in network.haplotypes shared pairwise segments. This empty dataframe would then be used in the generate_graph function and instead of failing the ig.Graph.DataFrame constructor would return an object with an empty list for the edgelist (.es) attribute. The Graphbase.community_walktrap function would later on try to use this attribute and since it was empty the code would fail. Now DRIVE checks to see if the redopd or redo_vs dataframes are empty. If they are empty DRIVE will continue onto the next network, except in debug mode where DRIVE will give a logging message explaining that a graph could not be constructed during the reclustering of that network.
@jtb324 jtb324 merged commit 750acb9 into main Feb 23, 2024
1 check failed
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

Successfully merging this pull request may close these issues.

1 participant