Comments (3)
Hi Bryan,
Thank you for your question! Could you maybe provide me with more information on what your data frames (both the pd_prot_long and the annotation df) look like exactly (column names and information contained in your columns)? This would really help me to see where the issue might be.
In theory, the joining should work if both data frames (i.e. the one you want to merge with the annotation and the annotation data frame) contain exactly the same file names in a column called "file_name" in both data frames.
Just an example:
# create example data frame with abundances and file names
abundance <- c(1,2,3,1,3,7)
file_name <- c(
"sample1",
"sample2",
"sample3",
"sample4",
"sample5",
"sample6"
)
data <- data.frame(file_name, abundance)
# create annotation data frame
condition <- c(
"control",
"control",
"control",
"treated",
"treated",
"treated"
)
annotation <- data.frame(file_name, condition)
# join both data frames
data_annotated <- data %>%
left_join(annotation, by = "file_name")
data_annotated
will then look like this:
view(data_annotated)
> data_annotated
file_name abundance condition
1 sample1 1 control
2 sample2 2 control
3 sample3 3 control
4 sample4 1 treated
5 sample5 3 treated
6 sample6 7 treated
All the best,
Dina
from protti.
I just had another look at your file_name
vector that you use to make the annotation data frame. To me it looks like your file names in your annotation data frame and pd_prot_long
do not match exactly.
E.g. in pd_prot_long
your first file name is "abundances_normalized_dmso_1"
whereas in your annotation data frame this is "Abundances Normalized DMSO 1"
.
If you change it to snake case ("abundances_normalized_dmso_1"
) in your annotation data frame this should work.
Please let me know if that helped you fix the issue.
All the best,
Dina
from protti.
Dina,
You're absolutely correct and I am embarrassed. This code works perfectly fine!
Thank you for the help and for designing such an easy to follow vignette for beginners in R!
Kind regards,
Bryan
from protti.
Related Issues (20)
- Facetting plots in qc_sequence_coverage() HOT 1
- Partial output of fetch_uniprot.R HOT 1
- Query regarding the drc_4p_plot HOT 2
- 'Timeout is reached' in fetch_uniprot HOT 15
- `qc_sample_correlation()` always returns a plot HOT 1
- Dose response benchmarking data HOT 4
- Add ungroup to normalise function HOT 2
- Add grouping argument to `calculate_sequence_coverage()` HOT 1
- Styler package for GitHub Actions
- qc_sequence_coverage() HOT 2
- assign_missingness() variables are hard coded HOT 1
- fetch_kegg.R doesnt join dataframe correctly HOT 3
- GO enrichment, enrichment type HOT 1
- Improvement to `assign_peptide_type()`
- `analyse_functional_network()` update default version
- fetch_uniprot accession HOT 3
- fetch_pdb() sodium ion
- fetch_uniprot - fails randomly
- qc_cvs factor compatibility HOT 1
- Make minimal peptides requirement flexible in calculate_protein_abundance()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from protti.