This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Converting a .frq file to a data frame?

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

2 answers

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

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

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.

Log in to answer this question.