Skip to content

Commit

Permalink
Merge branch 'main' into simon-comp-fig-1
Browse files Browse the repository at this point in the history
  • Loading branch information
simonleandergrimm committed Nov 28, 2023
2 parents 77700b9 + 66c052c commit 2c9c2de
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions figures/counts-by-pathogen-and-study.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

def start():
branch = "simon-validation-exclusion-run"
#ref = "ref"
# ref = "ref"
mgs_data = mgs.MGSData.from_repo(ref=branch)
pathogen_taxids_by_name = defaultdict(list)
for (
Expand Down Expand Up @@ -151,7 +151,7 @@ def start():
cellLoc="center",
loc="upper left",
)
fig.show()
fig.show()
fig.savefig(f"matching-reads-table_from{branch}.png", dpi=180)
plt.clf()

Expand Down
2 changes: 1 addition & 1 deletion fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def summarize_output(coeffs: pd.DataFrame) -> pd.DataFrame:

def start(num_samples: int, plot: bool) -> None:
branch = "simon-validation-exclusion-run"
print("Using mgs-pipeline branch simon-validation-exclusion-run")
print("Using mgs-pipeline branch simon-validation-exclusion-run")
figdir = Path("fig")
if plot:
figdir.mkdir(exist_ok=True)
Expand Down
7 changes: 3 additions & 4 deletions mgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,17 @@ class SampleAttributes(BaseModel):
country: str
state: Optional[str] = None
county: Optional[str] = None
location: Optional[str] = None #FIX ME
location: str
fine_location: Optional[str] = None
# Fixme: Not all the dates are real dates
date: date | str
reads: Optional[int] = None #FIX ME
reads: int
enrichment: Optional[Enrichment] = None
method: Optional[str] = None


def load_sample_attributes(repo: GitHubRepo) -> dict[Sample, SampleAttributes]:
data = json.loads(repo.get_file("dashboard/metadata_samples.json"))
print("Changed SampleAttributes in mgs.py to not require location or reads. Needs fixing.")
return {
Sample(s): SampleAttributes(**attribs) for s, attribs in data.items()
}
Expand Down Expand Up @@ -139,7 +138,7 @@ def from_repo(
ref=MGS_REPO_DEFAULTS["ref"],
):
repo = GitHubRepo(user, repo, ref)
print(repo, type(repo)) #FIX ME
print(repo, type(repo))
return MGSData(
bioprojects=load_bioprojects(repo),
sample_attrs=load_sample_attributes(repo),
Expand Down

0 comments on commit 2c9c2de

Please sign in to comment.