# LoadError: MethodError: no method matching open(::Nothing, ::String)

**URL:** https://discourse.julialang.org/t/loaderror-methoderror-no-method-matching-open-nothing-string/85438
**Category:** General Usage
**Tags:** question
**Created:** [August 7, 2022, 3:35pm UTC](https://discourse.julialang.org/t/loaderror-methoderror-no-method-matching-open-nothing-string/85438 "2022-08-07T15:35:51Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![caozhr](https://avatars.discourse-cdn.com/v4/letter/c/90db22/32.png) [@caozhr](https://discourse.julialang.org/u/caozhr)
#### Post date: [August 7, 2022, 3:35pm UTC](https://discourse.julialang.org/t/loaderror-methoderror-no-method-matching-open-nothing-string/85438/1 "2022-08-07T15:35:51Z")

</div>

I’m new to Julia.  
Here, some problems really puzzled me.  
here is my pipeline, and I think a mistake occurs in line 38:  
I don’t know how to modify it.

The mistake is:

```julia
ERROR: LoadError: MethodError: no method matching open(::Nothing, ::String)
Closest candidates are:
  open(!Matched::AbstractString, ::AbstractString) at iostream.jl:339
  open(!Matched::Function, ::Any...; kwargs...) at iostream.jl:367
  open(!Matched::Base.AbstractCmd, ::AbstractString) at process.jl:562
  ...
Stacktrace:
 [1] top-level scope at none:0
 [2] include at ./boot.jl:317 [inlined]
 [3] include_relative(::Module, ::String) at ./loading.jl:1044
 [4] include(::Module, ::String) at ./sysimg.jl:29
 [5] exec_options(::Base.JLOptions) at ./client.jl:266
 [6] _start() at ./client.jl:425
in expression starting at /data/caozhr/bin/ccontigs/ccontigs-1.0.0/ccontigs.jl:

```

The pipeline is:

```julia
! /Applications/Julia-0.4.5.app/Contents/Resources/julia/bin/julia
# Geoffrey Hannigan
# University of Michigan

# Setting dependencies
using BioAlignments
using BioSequences
using ArgParse

# Setup ArgParse
argx = ArgParseSettings()
@add_arg_table! argx begin
    "--input", "-i"
        help = "Input fasta file for identifying circular contigs."
    "--output", "-o"
        help = "Output file to write reults."
    "--length", "-l"
        help = "Length of sequence window for detecting repeats."
        default = 100
    "--thresh", "-t"
        help = "Threshold (percent of length) for circular contig."
        default = 0.97
end

parsed_args = parse_args(ARGS, argx)

problem = LocalAlignment()

scoremodel = AffineGapScoreModel(
    match=5,
    mismatch=-4,
    gap_open=-4,
    gap_extend=-1
)

filepath = parsed_args["input"]
fileout = parsed_args["output"]
outputfile = open(fileout, "w")
hitlength = parsed_args["length"]
threshold = hitlength * 5 * parsed_args["thresh"]
maxscore = hitlength * 5
print("Perfect alignment score is $maxscore\n")

for s in open( filepath, FASTA )
    alignment_result = pairalign(problem, s.seq[1:hitlength], s.seq[hitlength:e
    scorestring = score(alignment_result)
    seqname = s.name
    if scorestring > threshold
        write(outputfile, "$seqname\t$scorestring\n")
    end
end

```

I don’t know how to solve it. Waiting for help.

---

<div class="post-metadata">

### Author: ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)
#### Post date: [August 7, 2022, 5:43pm UTC](https://discourse.julialang.org/t/loaderror-methoderror-no-method-matching-open-nothing-string/85438/2 "2022-08-07T17:43:51Z")

</div>

Check, e.g. with a print, if `fileout` and `filepath` are defined and are set to what you expect.
