Converting a .frq file to a data frame?
2
0
Entering edit mode
12 months ago
arnold • 0

Hi! I'm a bit new to the whole bioinformatics community and I'm working with MAF's stored in a .frq file that looks like this:

CHROM   POS N_ALLELES   N_CHR   {ALLELE:FREQ}
AE014298.5  5694    2   0   AAAAAAAAAAAAAACCAGC:-nan    AAAAAAAAAAGTTAAAAAAATAAAACCAGC:-nan
AE014298.5  51946   2   0   A:-nan  G:-nan

I'm having a bit of trouble trying to read-in this file in R and was wondering if anyone had any advice for reading in such a table because the header contains 5 values and the actual table has 6 values.

R • 998 views
ADD COMMENT
1
Entering edit mode
12 months ago
zau saa ▴ 150

simply add a word to line 1 as the name of column 6

ADD COMMENT
1
Entering edit mode

Also get rid of the curly braces in the col5 header {}

ADD REPLY
0
Entering edit mode
12 months ago
Ram 44k

Use read.table - if the number of columns in the header is one fewer than the rest of the lines, it will assign the first column as rownames.

Side note: "convert" is not even close to the right word here. You're not changing data formats at all, you're reading a file into memory.

ADD COMMENT

Login before adding your answer.

Traffic: 1636 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6