EcoJulia / Microbiome.jl

For analysis of microbiome and microbial community data
Other
47 stars 10 forks source link

Selecting samples by vector of strings preserves order of original profile #143

Open kescobo opened 4 months ago

kescobo commented 4 months ago

eg

julia> comm = CommunityProfile(rand(10, 4), Taxon.(["t$i" for i in 1:10]), MicrobiomeSample.(["s$i" for i in 1:4]))
CommunityProfile{Float64, Taxon, MicrobiomeSample} with 10 features in 4 samples

Feature names:
t1, t2, t3...t9, t10

Sample names:
s1, s2, s3, s4

julia> comm[:, ["s4", "s1"]]
CommunityProfile{Float64, Taxon, MicrobiomeSample} with 10 features in 2 samples

Feature names:
t1, t2, t3...t9, t10

Sample names:
s1, s4