debug url reading

This commit is contained in:
Eric Coissac
2025-11-18 15:30:06 +01:00
parent 4603d7973e
commit cef29005a5
3 changed files with 9 additions and 3 deletions

View File

@@ -112,7 +112,6 @@ func ReadSequencesFromFile(filename string,
var err error
options = append(options, OptionsSource(obiutils.RemoveAllExt((path.Base(filename)))))
file, err = obiutils.Ropen(filename)
if err == obiutils.ErrNoContent {

View File

@@ -234,7 +234,6 @@ func (taxo *TaxonSet) AsPhyloTree(root *TaxNode) (*obiphylo.PhyloNode, error) {
nodes := make(map[*string]*obiphylo.PhyloNode, taxo.Len())
tsi := taxo.Iterator()
log.Warnf("Coucou")
for tsi.Next() {
taxon := tsi.Get()
id := taxon.Node.Id()

View File

@@ -19,6 +19,13 @@ func ExpandListOfFiles(check_ext bool, filenames ...string) ([]string, error) {
list_of_files := orderedset.NewOrderedSet()
for _, fn := range filenames {
if strings.HasPrefix(fn, "http://") ||
strings.HasPrefix(fn, "https://") ||
strings.HasPrefix(fn, "ftp://") {
list_of_files.Add(fn)
continue
}
err = filepath.Walk(fn,
func(path string, info os.FileInfo, err error) error {
var e error
@@ -147,7 +154,6 @@ func CLIReadBioSequences(filenames ...string) (obiiter.IBioSequence, error) {
if err != nil {
return obiiter.NilIBioSequence, err
}
switch CLIInputFormat() {
case "fastq", "fq":
reader = obiformats.ReadFastqFromFile
@@ -178,8 +184,10 @@ func CLIReadBioSequences(filenames ...string) (obiiter.IBioSequence, error) {
nreader,
opts...,
)
} else {
if len(list_of_files) > 0 {
iterator, err = reader(list_of_files[0], opts...)
if err != nil {