<p>I would like to use the Gviz package but my I have a reference genome in FASTA format, not as a valid UCSC genome (it was not published yet).<br />
<br />
It is possible to use this FASTA file instead?<br />
<br />
Let&acute;s say that I have one genome in FASTA format on disk:</p>

<pre>
library(Biostrings)
ncrna &lt;- readDNAStringSet(file = &quot;GTgenome.fa&quot;)

head(ncrna)
  A DNAStringSet instance of length 6
       width seq                                            names
[1] 20202851 CCCAGTTTTCCCCACTCTGTGA...AAAGATCTTACAACCGATTTT chr10 Major...
[2] 20315886 AGCCGACGAGACTCACAGAACC...TCACAAACCCCCTCGGGAGGG chr11 Major...
[3] 20466350 GATTAGACCTCCGAAAGGGGTA...ATTATTAATTATTAAATATTA chr12 Major...
[4] 16480340 GTCTCCACTTGCCCCACAACGG...AGATGACGATGATGAAGATGA chr13 Major...
[5] 16193477 CTCTGTGACATCACAGCCATGG...GGGTTACACACGTTGTTTTTT chr14 Major...</pre>

<p>Using the object created to replace a UCSC genome:</p>

<pre>
ideoTrack &lt;- IdeogramTrack(genome=ncrna, chromosome=&quot;chr10&quot;, fontsize=14)

Error in .Call2(&quot;new_XStringSet_from_CHARACTER&quot;, ans_class, ans_elementType,  :
  key 51 (char &#39;3&#39;) not in lookup table
In addition: Warning message:
In if (!token %in% base::ls(env)) { :
  the condition has length &gt; 1 and only the first element will be used</pre>

<p>I am probably misunderstanding a very basic feature here, but I would be grateful for some help!</p>

I am not sure if I fully understood the problem, but what you could try is to replace an UCSC Ideogram with your own data. This solution is certainly not the best way, but I'm not that familiar with the Gviz package.

Build a track from, for example the human genome chr22. Subsequently, replace the necessary slots (range, chromosome bands and names) with your own data.

    library(Gviz)
    ideoTrack <- IdeogramTrack(genome = "hg38",chromosome = "chr22")
    plotTracks(ideoTrack,from = 1,to = 1000000)
    
    # set your own
    my_ideoTrack <- ideoTrack
    
    # RANGE
    START=seq(1,100,10)
    END=seq(10,100,10)
    RANGES <- GRanges(seqnames = c(letters[1:10]),IRanges(start =START ,end =END))
    
    # arbitrary Giemsa staining
    GS <- c("gneg", "gpos100",  "gpos25","acen",  "gpos50",  "gpos75",    "gvar",   "stalk" ,NA,NA)
    bt <- data.frame(chrom="own1",chromStart= seq(1,100,10),chromEnd=seq(10,100,10),name=letters[1:10],gieStain=GS)
    
    # chromosome name
    CHR <- "own1"
    
    # Replace with your own data
    my_ideoTrack@range <- RANGES
    my_ideoTrack@chromosome <- CHR
    my_ideoTrack@name <- CHR
    my_ideoTrack@bandTable <- bt
    
    # set UCSC chromosome Names False
    options(ucscChromosomeNames=FALSE)
    gx <- GenomeAxisTrack()
    # Plot
    plotTracks(list(my_ideoTrack,gx),from = 1,to = 15)