This is a test version of Biostars. For the public version, visit https://www.biostars.org.
I want to output a file in R where I will print the longest locus.

I have the human tabular file from NCBI. ( https://www.ncbi.nlm.nih.gov/genome/browse/#!/proteins/51/1820449%7CHomo%20sapiens/) And for each locus in this file, I want to get the longest ones in R. What path can I follow?

It repeats AGER in the Locus column and when I checked it I need to get it as the longest AGER is in the 16th row

r programming locus lenght

You want the longest locus relative to what, the gene ID?

ID is unimportant. As length and locus

library("tidyverse")

read_csv("file.csv") |>
  group_by(Locus) |>
  slice_max(Length, n=1) |>
  ungroup()

0 answers

No answers yet.

Log in to answer this question.