Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaceves committed Aug 21, 2019
2 parents 9832e72 + c901879 commit 4380d5e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion code/redu_pca.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def calculate_master_projection(input_file_occurrences_table, components = 5):

#convert it into the correct format for the return
sparse_occ_matrix = pd.DataFrame(index = list(unique_compounds), columns = list(unique_sample), data = matrix)


#bring in metadata
master_metadata_file = pd.read_csv(config.PATH_TO_ORIGINAL_MAPPING_FILE, "\t")
Expand Down Expand Up @@ -169,6 +168,7 @@ def emperor_output(sklearn_output, full_file_list, eigenvalues, percent_variance
global_metadata.rename(columns = {'filename': 'SampleID'}, inplace = True)
global_metadata["type"] = "Global Data"
global_metadata.set_index("SampleID", inplace = True)

common = global_metadata

#this part is for the user uploaded metadata file
Expand All @@ -179,6 +179,7 @@ def emperor_output(sklearn_output, full_file_list, eigenvalues, percent_variance
metadata_uploaded.set_index("SampleID", inplace = True)

common = pd.concat([global_metadata, metadata_uploaded])



#so you need to align the metadata and the files contained within the ordination file BEFORE feeding it into the Emperor thing otherwise it doesn't like to output results
Expand Down

0 comments on commit 4380d5e

Please sign in to comment.