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

Edits to Rep.parse() #298

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions ipyrad/analysis/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ def __init__(self, repfile, kpop):

## get table string
psearch = re.compile(r"\) : ")
dsearch = re.compile(r"\) \d : ")
dsearch = re.compile(r"\)\s+\d+ : ")
self.stable = self.parse(psearch, dsearch)

## record if it is high variance
Expand Down Expand Up @@ -875,15 +875,16 @@ def parse(self, psearch, dsearch):

elif popline:
## check if sample is supervised...
## pidx not work when structure file contains pop data (but no popflags) for more than kpops
abc = line.strip().split()
prop = ["0.000"] * self.kpop
pidx = int(abc[3]) - 1
prop[pidx] = "1.000"
#prop = ["0.000"] * self.kpop
#pidx = int(abc[3]) - 1
#prop[pidx] = "1.000"
outstr = "{}{}{}".format(
" ".join([abc[0], abc[0], abc[2],
abc[0].split('.')[0]]),
abc[3].split('.')[0]]),
" : ",
" ".join(prop)
" ".join(abc[5:])
)
self.inds += 1
stable += outstr+"\n"
Expand Down