Use native client to read annotations.csv.
authorTom Clegg <tom@curii.com>
Mon, 17 Jan 2022 18:03:44 +0000 (13:03 -0500)
committerTom Clegg <tom@curii.com>
Mon, 17 Jan 2022 18:03:44 +0000 (13:03 -0500)
refs #18581

Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

anno2vcf.go
exportnumpy.go
vcf2fasta.go

index 23c6f21ece59f6c6b8ad7997472248519db12464..85d89eb45896ae00ce50c230a353e60c91f44565 100644 (file)
@@ -10,7 +10,6 @@ import (
        "flag"
        "fmt"
        "io"
-       "io/ioutil"
        "net/http"
        _ "net/http/pprof"
        "os"
@@ -118,10 +117,16 @@ func (cmd *anno2vcf) RunCommand(prog string, args []string, stdin io.Reader, std
                filename := *inputDir + "/" + fi.Name()
                thr.Go(func() error {
                        log.Printf("reading %s", filename)
-                       buf, err := ioutil.ReadFile(filename)
+                       f, err := open(filename)
+                       if err != nil {
+                               return err
+                       }
+                       defer f.Close()
+                       buf, err := io.ReadAll(f)
                        if err != nil {
                                return fmt.Errorf("%s: %s", filename, err)
                        }
+                       f.Close()
                        lines := bytes.Split(buf, []byte{'\n'})
                        calls := map[string][]*call{}
                        for lineIdx, line := range lines {
index c5a2b7af4ea31eb7bf2008a45321addf2b96bdac..27c86a32107a98faf1952eaffe5fae477faa7213 100644 (file)
@@ -411,7 +411,7 @@ func makeMask(regionsFilename string, expandRegions int) (*mask, error) {
                return nil, err
        }
        defer rfile.Close()
-       regions, err := ioutil.ReadAll(rfile)
+       regions, err := io.ReadAll(rfile)
        if err != nil {
                return nil, err
        }
index e1a3a3944ebfbbf1d77fce5e6dd6f95b8fb9c323..3ca18c410f078f1af1395a3b8034fc2db536cbfa 100644 (file)
@@ -475,7 +475,7 @@ func (cmd *vcf2fasta) loadRegionsPy() error {
                if resp.StatusCode != http.StatusOK {
                        return fmt.Errorf("get %q: http status %d", cmd.gvcfRegionsPy, resp.StatusCode)
                }
-               buf, err := ioutil.ReadAll(resp.Body)
+               buf, err := io.ReadAll(resp.Body)
                if err != nil {
                        return fmt.Errorf("get %q: read body: %s", cmd.gvcfRegionsPy, err)
                }