How to replace/fill "Ns" in fasta with reference file having same coordinates

Hope you are doing great. As asked in title, please guide if there is any way to fill or replace N or N's in fasta file with the help of reference file.

For example

INPUT

Fasta with Ns

>fasta1
ACTGGCATCATGNNNNACTTTTGACC

Reference Fasta

>reference
ACTGGCATCATGTCAGACTTTTGACC

OUTPUT

>fasta1
ACTGGCATCATGTCAGACTTTTGACC

I will really appreciate any help in this regard

1 answer

  • answered 2021-11-27 19:26 Ed Morton

    If this (tongue in cheek) isn't all you need:

    $ head -1 FastaWithNs; tail -1 ReferenceFasta
    >fasta1
    ACTGGCATCATGTCAGACTTTTGACC
    

    then edit your question to better describe your requirements and provide more truly representative sample input/output.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum