Thank you Pierre! I just tried it and i get this
samtools view SRR11409417.sorted.bam "NC_045512.2:29090-29096" | java -jar JavaKit/jvarkit/dist/sam2tsv.jar -R SARS-CoV-2_reference.fasta
[SEVERE][MultiBamLauncher]Dictionary missing : A Sequence dictionary is missing for <bam>. A Bam should have a header with a set of lines starting with '@SQ' see https://samtools.github.io/hts-specs/SAMv1.pdf com.github.lindenb.jvarkit.lang.JvarkitException$BamDictionaryMissing: Dictionary missing : A Sequence dictionary is missing for <bam>. A Bam should have a header with a set of lines starting with '@SQ' see https://samtools.github.io/hts-specs/SAMv1.pdf at com.github.lindenb.jvarkit.util.bio.SequenceDictionaryUtils.extractRequired(SequenceDictionaryUtils.java:166) at com.github.lindenb.jvarkit.jcommander.MultiBamLauncher.doWork(MultiBamLauncher.java:242) at com.github.lindenb.jvarkit.util.jcommander.Launcher.instanceMain(Launcher.java:796) at com.github.lindenb.jvarkit.util.jcommander.Launcher.instanceMainWithExit(Launcher.java:959) at com.github.lindenb.jvarkit.tools.sam2tsv.Sam2Tsv.main(Sam2Tsv.java:441) [INFO][Launcher]sam2tsv Exited with failure (-1)
I'm not quite sure it is that you are looking for, but I have you considered a bedgraph or wig file?
I prefer
bedtools coveragefor parsing out coverage info from abamfile, for info at https://bedtools.readthedocs.io/en/latest/content/tools/coverage.html