Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8474125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:32:31+00:00 2026-06-10T17:32:31+00:00

I have a very large data set that contains multiple groups. They all contain

  • 0

I have a very large data set that contains multiple groups. They all contain the same information, however, occasionally and inconsistently, this information is misordered.
In the example below, The Group1_A1 and Group2_A1 columns do not match (Rows 3 & 4 are flipped), therefore the rest of the information in those rows are not comparable. In order to correct this, the BETA of GROUP1_BETA should be multipled by -1 (again, given that the A1 columns between groups do not match, if they do match, the Beta should remain as it is).

MARKER  GROUP1_A1  GROUP1_A2  GROUP1_BETA  GROUP1_SE  GROUP2_A1  GROUP2_A2  GROUP2_BETA GROUP2_SE
rs10        A         C         -0.055      0.003        A         C           0.056      0.200
rs1000      A         G          0.208      0.100        A         G           0.208      0.001
rs10000     G         C         -0.134      0.009        C         G          -0.8624     0.010
rs10001     C         A          0.229      0.012        A         C           0.775      0.003

When dealing with frequencies falling between 0-1, I was using:

data$GROUP1_oppositeFrequency <- abs( (as.character(data$Group2_A1) != 
                            as.character(data$Group1_A1)) -                   
                          as.numeric(data$Group1_Frequency) )

however, because Beta values can be negative, this is not going to work. Can anyone point me in the right direction?

Reproducible Data:

data <- textConnection("SNP,GROUP1_A1,GROUP1_A2,GROUP1_Beta,GROUP1_SE,GROUP2_A1,GROUP2_A2,GROUP2_Beta,GROUP2_SE,GROUP3_A1,GROUP3_A2,GROUP3_Beta,GROUP3_SE
rs1050,C,T,0.0462,0.0035,T,C,0.007,0.0039,C,T,-0.007,0.009
rs1073,A,G,-0.0209,0.0035,A,G,0.0004,0.0031,A,G,-0.009,0.013
rs1075,C,T,-0.001,0.0039,T,C,-0.0013,0.0028,C,T,0.004,0.011
rs1085,C,G,-0.0001,0.0068,C,G,-0.0027,0.0032,C,G,-0.049,0.026
rs1127,C,T,0.0015,0.0044,T,C,0.0002,0.0029,C,T,-0.017,0.009
rs1312,A,G,-0.0014,0.0039,A,G,-0.0025,0.0029,A,G,0,0.01")
test_data <- read.csv(data, header = TRUE, sep = ",")
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T17:32:32+00:00Added an answer on June 10, 2026 at 5:32 pm

    Assuming the only possibility is a “flip” , all you need to do is see if the value in group1_a1 is identical to the value in group2_a1 Hence:

    mydata$group1_beta <- mydata$group1_beta * (-1)^((mydata$group1_a1 == mydata$group2_a1) + 1)
    

    Update: here’s an example, showing it works (at least, the way I meant it to work 🙂 ).

     Rgames> mydat<-data.frame(A=c('a','b','d','c'),B=c('a','b','c','d'),one=1:4,two=1:4)
    Rgames> mydat
      A B one two
    1 a a   1   1
    2 b b   2   2
    3 d c   3   3
    4 c d   4   4
    Rgames> mydat$two<-mydat$two*(-1)^((mydat$A==mydat$B)+1)
    Rgames> mydat
      A B one two
    1 a a   1   1
    2 b b   2   2
    3 d c   3  -3
    4 c d   4  -4
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very large possible data set that I am trying to visualize
I have a very large data set that I'm trying to find the smallest
I have a query that returns a very large data set. I cannot copy
I have a very large data set that I'd like to craft into a
I have a webpage that displays a very large list of data. Since this
I have a very large set of permissions in my application that I represent
I have a very large set of data (~3 million records) which needs to
I have a very large data set, and I have already split it into
I have a large data set that I want to clean up for the
I have three custom functions that do very similar things: they pull different data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.