0

everyone, I want to know if there is an efficienct way to know if a coordinate locate in a region. Just like picture below. I want to know each coordinate locate which region below table and get corresponding feature. enter image description here

ruiyan hou
  • 11
  • 4
  • Anyone can help? Thanks! – ruiyan hou May 07 '22 at 01:03
  • So basically check if start of the first dataframe is between the other dataframes start and end columns? Kindly share sample dataframes with expected output – sammywemmy May 07 '22 at 01:05
  • The expected output looks like this. tCRE_name TSS_start_site. category 21652 P:r1@PIK3R1 68215761. 5'-UTR 21654 P:r3@PIK3R1 68239844. 3'-UTR 21657 P:r2@PIK3R1 68280356. CDS 21658 P:r4@PIK3R1 68288098. CDS – ruiyan hou May 07 '22 at 01:14

1 Answers1

0

I think you want

for s in bladderselecteddf.TSS_Start_Site:
    genes = refdf[ (s >= refdf.Start) & (s <= refdf.End) ].gene_name

From your question, it is a little difficult to figure out exactly what you want.

ssm
  • 5,277
  • 1
  • 24
  • 42