This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Ensembl chromosome name?

Hi

I am using Ensembl genome references. Ensembl chromosome names don't have the 'chr' prefix in front of the chromosome name. How I can add 'chr' prefix to my cufflinks output file (genes.FPKM_tracking)

thanks in advance

rna-seq

1 answer

Do you need something like this?

awk -F'\t' '/^CUFF/{print $1"\t"$2"\t"$3"\t"$4"\t"$5"\t"$6"\tchr"$7"\t"$8"\t"$9"\t"$10"\t"$11"\t"$12"\t"$13}' genes.fpkm_tracking

Thank you for reply, My file is look like this:

gene_short_name    locus     start     end       length        FPKM
DDX11L1                  1        11868   14409    2541        9.03982
MIR1302-1                1        29553   31109    1556        0.258852
WASH7P                   1        14403   29570    15167      8.63596
MIR6859-1                1        17368   17436     68          122.591
FAM138A    1    34553    36081    1528    0.147847
OR4F5    1    69090    70008    918    0.007485
RP11-34P13.7    1    89294    133723    44429    3.49524
RP11-34P13.8    1    89550    91105    1555    1.38877
...

I wants to add "chr" prefix in front of the chromosome name.

Oh, so in that case, it would be like this:

awk -F'\t' '/^CUFF/{print $1"\tchr"$2"\t"$3"\t"$4"\t"$5"\t"$6}' genes.fpkm_tracking
awk 'BEGIN{OFS="\t"}{print $1,"chr"$2,$3,$4,$5,$6}' genes.fpkm_tracking > genes_chr.fpkm_tracking

where genes_chr.fpkm_tracking is the new file with 'chr'

Log in to answer this question.