--- title: "Filter Motifs from MS2LDA" author: "David Elser" date: "04.03.2021" output: html_document --- #Read a Simple csv File ```{r} mydata = read.csv("MS2LDA.csv") ``` ```{r} head(mydata) str(mydata) ``` # Count Motifs and print top occurences ```{r} library(dplyr) motifnb=mydata %>% group_by(Motif) %>% tally() top=motifnb[with(motifnb,order(-n)),] head(top) ``` # Create List with specific motifs ```{r} removed=mydata[(mydata$Motif == "motif_534" | mydata$Motif == "motif_667"), ] head(removed) str(removed) ``` # Removed motifs according filterd list ```{r} shortlist=setdiff(mydata, removed) head(shortlist) str(shortlist) ```